Skip to content

Instantly share code, notes, and snippets.

@pydanny
Created April 15, 2011 06:31
Show Gist options
  • Select an option

  • Save pydanny/921252 to your computer and use it in GitHub Desktop.

Select an option

Save pydanny/921252 to your computer and use it in GitHub Desktop.
Generic IDS from fixtures in tests is the DEVIL!
# 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)
@pydanny
Copy link
Copy Markdown
Author

pydanny commented Apr 15, 2011

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!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment