You’ll need to figure out a place to store the usernames and passwords for your local,
staging, and production Postgres servers. Since, for security, you probably don’t want
them in your code repository, look into ways of modifying your deploy scripts to pass
them in at the command line. Environment variables are one popular solution for where
to keep them…
Experiment with keeping your unit tests running with SQLite, and compare how much
faster they are than running against Postgres. Set it up so that your local machine uses
SQLite for testing, but your CI server uses Postgres.
Run Your Tests Against Different Browsers
Selenium supports all sorts of different browsers, including Chrome and Internet Ex‐
ploder. Try them both out and see if your FT suite behaves any differently.
You should also check out a “headless” browser like PhantomJS.
In my experience, switching browsers tends to expose all sorts of race conditions in
Selenium tests, and you will probably need to use the interaction/wait pattern a lot more
(particularly for PhantomJS).
404 and 500 Tests
A professional site needs good looking error pages. Testing a 404 page is easy, but you’ll
probably need a custom “raise an exception on purpose” view to test the 500 page.
The Django Admin Site
Imagine a story where a user emails you wanting to “claim” an anonymous list. Let’s say
we implement a manual solution to this, involving the site administrator manually
changing the record using the Django admin site.
Find out how to switch on the admin site, and have a play with it. Write an FT that shows
a normal, non-logged-in user creating a list, then have an admin user log in, go to the
admin site, and assign the list to the user. The user can then see it in their “My Lists”
page.
Investigate a BDD Tool
BDD stands for Behaviour-Driven Development. It’s a way of writing tests that should
make them more human-readable, by implementing a sort of Domain-Specific Lan‐
guage (DSL) for your FT code. Check out Lettuce (a Python BDD framework) and use
it to rewrite an existing FT, or write a new one.
434
|
Appendix E: What to Do Next