Created
April 15, 2011 06:31
-
-
Save pydanny/921252 to your computer and use it in GitHub Desktop.
Generic IDS from fixtures in tests is the DEVIL!
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # Test form post for existing grid package | |
| response = self.client.post(url, { | |
| 'package': 2, | |
| }) | |
| self.assertContains(response, | |
| ''Supertester' is already in this grid.') | |
| # Test form post for new grid package | |
| count = GridPackage.objects.count() | |
| response = self.client.post(url, { | |
| 'package': 4, | |
| }, follow=True) |
Author
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
That package is set by fixture IDs makes this test very fragile. Makes refactoring code a pain, especially when you have dozens of these in the tests. Taking notes to prevent this in the future!