Skip to content

Commit

Permalink
Don't assume PKs in tests
Browse files Browse the repository at this point in the history
    - Assuming certain primary keys exist is often DB dependent and for
      example this breaks the ability to use py.test with --reuse-db
      option
  • Loading branch information
frankwiles committed May 2, 2015
1 parent 95d1037 commit 5240279
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions jobs/tests/test_views.py
Expand Up @@ -475,7 +475,7 @@ def test_job_comment(self):
self.assertEqual(len(mail.outbox), 0)
response = self.client.post(url, form_data)
self.assertEqual(response.status_code, 302)
self.assertEqual(response['Location'], 'http://testserver/comments/posted/?c=1')
self.assertTrue('http://testserver/comments/posted/?c=' in response['Location'])

mail_sent_queue.get(block=True)
self.assertEqual(len(mail.outbox), 1)
Expand All @@ -494,7 +494,7 @@ def test_job_comment(self):
form_data.update(form.initial)
response = self.client.post(url, form_data)
self.assertEqual(response.status_code, 302)
self.assertEqual(response['Location'], 'http://testserver/comments/posted/?c=2')
self.assertTrue('http://testserver/comments/posted/?c=' in response['Location'])

mail_sent_queue.get(block=True)
self.assertEqual(len(mail.outbox), 3)
Expand Down

0 comments on commit 5240279

Please sign in to comment.