Fix duplicate tags test

This commit is contained in:
Sascha Ißbrücker 2021-01-13 09:43:17 +01:00
parent 2d62ba3710
commit bea0fe3b70

View file

@ -43,11 +43,11 @@ class TagTestCase(TestCase):
self.assertEqual(first_tag.id, second_tag.id)
def test_get_or_create_tag_should_handle_legacy_dbs_with_existing_duplicates(self):
Tag.objects.create(name='book', date_added=timezone.now(), owner=self.user)
first_tag = Tag.objects.create(name='book', date_added=timezone.now(), owner=self.user)
Tag.objects.create(name='Book', date_added=timezone.now(), owner=self.user)
first_tag = get_or_create_tag('Book', self.user)
retrieved_tag = get_or_create_tag('Book', self.user)
self.assertEqual(first_tag.id, first_tag.id)
self.assertEqual(first_tag.id, retrieved_tag.id)
def test_get_or_create_tags_should_return_tags(self):
books_tag = get_or_create_tag('Book', self.user)