diff --git a/src/inventory_project/tests/test_admin_item.py b/src/inventory_project/tests/test_admin_item.py index ef8ef1d..9c4c992 100644 --- a/src/inventory_project/tests/test_admin_item.py +++ b/src/inventory_project/tests/test_admin_item.py @@ -11,6 +11,7 @@ from django.template.defaulttags import CsrfTokenNode, NowNode from django.test import TestCase, override_settings from django.utils import timezone from django_tools.unittest_utils.mockup import ImageDummy +from reversion.models import Revision from inventory import __version__ from inventory.models import ItemImageModel, ItemModel @@ -144,6 +145,10 @@ class AdminTestCase(HtmlAssertionMixin, TestCase): html = html.replace(str(item.pk), '') assert_html_snapshot(got=html, validate=False) + # django-revision integration: + comments = list(Revision.objects.order_by('date_created').values_list('comment', flat=True)) + self.assertEqual(comments, ['Added.']) + def test_new_item_with_image(self): """ https://github.com/jedie/PyInventory/issues/33 diff --git a/src/inventory_project/tests/test_admin_memo.py b/src/inventory_project/tests/test_admin_memo.py index a48def2..305e0cd 100644 --- a/src/inventory_project/tests/test_admin_memo.py +++ b/src/inventory_project/tests/test_admin_memo.py @@ -9,6 +9,7 @@ from django.template.defaulttags import CsrfTokenNode, NowNode from django.test import TestCase, override_settings from django_tools.unittest_utils.mockup import ImageDummy from model_bakery import baker +from reversion.models import Revision from inventory import __version__ from inventory.models import MemoImageModel, MemoModel @@ -98,6 +99,10 @@ class AdminTestCase(HtmlAssertionMixin, TestCase): assert item.user_id == self.normaluser.pk + # django-revision integration: + comments = list(Revision.objects.order_by('date_created').values_list('comment', flat=True)) + self.assertEqual(comments, ['Added.']) + def test_new_item_with_image(self): """ https://github.com/jedie/PyInventory/issues/33