Improved test_post_reorder test

This commit is contained in:
Karl Hobley 2014-07-04 11:39:42 +01:00
parent c7ec5792f6
commit 56647908d0

View file

@ -218,6 +218,10 @@ class TestEditorsPicksEditView(TestCase, WagtailTestUtils):
# User should be redirected back to the index
self.assertRedirects(response, reverse('wagtailsearch_editorspicks_index'))
# Check that the ordering has been saved correctly
self.assertEqual(models.EditorsPick.objects.get(id=self.editors_pick.id).sort_order, 1)
self.assertEqual(models.EditorsPick.objects.get(id=self.editors_pick_2.id).sort_order, 0)
# Check that the recommendations were reordered
self.assertEqual(models.Query.get("Hello").editors_picks.all()[0], self.editors_pick_2)
self.assertEqual(models.Query.get("Hello").editors_picks.all()[1], self.editors_pick)