Skip to content

Commit 5b786bc

Browse files
author
Marius Schulze
committed
test: add model test for new deletion behaviour
1 parent e19fd5d commit 5b786bc

File tree

1 file changed

+13
-1
lines changed

1 file changed

+13
-1
lines changed

tests/test_models.py

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,11 @@
11
from cms.test_utils.testcases import CMSTestCase
22

3-
from djangocms_snippet.models import SEARCH_ENABLED, Snippet, SnippetPtr
3+
from djangocms_snippet.models import (
4+
SEARCH_ENABLED,
5+
Snippet,
6+
SnippetGrouper,
7+
SnippetPtr,
8+
)
49

510
from .utils.factories import SnippetPluginFactory, SnippetWithVersionFactory
611

@@ -41,3 +46,10 @@ def test_snippet_ptr_instance(self):
4146

4247
# test strings
4348
self.assertEqual(instance.snippet_grouper.name, "test snippet")
49+
50+
def test_snippet_grouper_deletion(self):
51+
grouper = SnippetGrouper.objects.all()
52+
self.assertEqual(grouper.count(), 1)
53+
self.snippet.delete()
54+
grouper = SnippetGrouper.objects.all()
55+
self.assertEqual(grouper.count(), 0)

0 commit comments

Comments
 (0)