Check django-revision integration

pull/124/head
JensDiemer 2022-10-03 18:01:38 +02:00
rodzic 0f07ce4f2e
commit 27e499469c
2 zmienionych plików z 10 dodań i 0 usunięć

Wyświetl plik

@ -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), '<removed-UUID>')
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

Wyświetl plik

@ -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