Skip to content

Commit

Permalink
Add test for invalid history form
Browse files Browse the repository at this point in the history
  • Loading branch information
treyhunner committed May 4, 2013
1 parent 4447218 commit f2780a4
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions simple_history/tests/tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -336,6 +336,15 @@ def test_history_form_permission(self):
person = Person.objects.create(name='Sandra Hale')
self.app.get(get_history_url(person, 0), status=403)

def test_invalid_history_form(self):
self.login()
poll = Poll.objects.create(question="why?", pub_date=today)
response = self.app.get(get_history_url(poll, 0))
response.form['question'] = ""
response = response.form.submit()
self.assertEqual(response.status_code, 200)
self.assertIn("This field is required", response.content)

def test_history_form(self):
self.login()
poll = Poll.objects.create(question="why?", pub_date=today)
Expand Down

0 comments on commit f2780a4

Please sign in to comment.