Skip to content

Commit

Permalink
edit_section view test coverage
Browse files Browse the repository at this point in the history
  • Loading branch information
sdreher committed Mar 22, 2017
1 parent 1df8c78 commit dfe0a6b
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions pagetree/tests/test_views.py
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,23 @@ def test_edit_section(self):
dict(label="new label"))
self.assertEqual(response.status_code, 302)

self.section3.refresh_from_db()
self.assertEquals(self.section3.label, 'new label')
self.assertEquals(self.section3.slug, 'new-label')
self.assertFalse(self.section3.show_toc)
self.assertFalse(self.section3.deep_toc)

response = self.c.post(
"/pagetree/edit_section/%d/" % self.section3.id,
dict(label="Longer Label", show_toc='on', deep_toc='True'))
self.assertEqual(response.status_code, 302)

self.section3.refresh_from_db()
self.assertEquals(self.section3.label, 'Longer Label')
self.assertEquals(self.section3.slug, 'longer-label')
self.assertTrue(self.section3.show_toc)
self.assertTrue(self.section3.deep_toc)

def test_add_child_section(self):
response = self.c.post(
"/pagetree/section/add/%d/" % self.section3.id,
Expand Down

0 comments on commit dfe0a6b

Please sign in to comment.