test that tags on saved snippets are not an empty list

This commit is contained in:
Matt Westcott 2015-09-03 12:38:46 +01:00
parent cb0b9b7f0e
commit e2e933a785

View file

@ -154,9 +154,12 @@ class TestSnippetCreateView(TestCase, WagtailTestUtils):
args=('tests', 'advert')))
snippet = Advert.objects.get(text='test_advert')
expected_tags = list(Tag.objects.order_by('name').filter(name__in=tags))
self.assertEqual(len(expected_tags), 2)
self.assertEqual(
list(snippet.tags.order_by('name')),
list(Tag.objects.order_by('name').filter(name__in=tags)))
expected_tags)
class TestSnippetEditView(TestCase, WagtailTestUtils):
@ -213,9 +216,12 @@ class TestSnippetEditView(TestCase, WagtailTestUtils):
args=('tests', 'advert')))
snippet = Advert.objects.get(text='edited_test_advert')
expected_tags = list(Tag.objects.order_by('name').filter(name__in=tags))
self.assertEqual(len(expected_tags), 2)
self.assertEqual(
list(snippet.tags.order_by('name')),
list(Tag.objects.order_by('name').filter(name__in=tags)))
expected_tags)
class TestSnippetDelete(TestCase, WagtailTestUtils):