Skip to content

Commit

Permalink
corrected formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
vipulnarang95 committed May 14, 2024
1 parent 206996f commit acd053a
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 6 deletions.
1 change: 0 additions & 1 deletion CHANGELOG.rst
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ Changelog
Unreleased
==========
* feat: Added sites support for Snippets
* feat: Added site filter in Snippet Admin
* add support for python 3.10
* add support for django 4.2
* drop support for django < 3.2
Expand Down
21 changes: 16 additions & 5 deletions tests/test_admin.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,12 +48,23 @@ def test_get_queryset(self):
snippet_grouper=SnippetGrouper.objects.create(),
site=another_site
)
current_site_snippet_version = Version.objects.create(content=current_site_snippet, created_by=self.superuser, state='published')
another_site_snippet_version = Version.objects.create(content=another_site_snippet, created_by=self.superuser, state='published')
current_site_snippet_version = Version.objects.create(

Check failure on line 51 in tests/test_admin.py

View workflow job for this annotation

GitHub Actions / flake8

local variable 'current_site_snippet_version' is assigned to but never used
content=current_site_snippet,

Check warning on line 52 in tests/test_admin.py

View workflow job for this annotation

GitHub Actions / flake8

trailing whitespace
created_by=self.superuser,

Check warning on line 53 in tests/test_admin.py

View workflow job for this annotation

GitHub Actions / flake8

trailing whitespace
state='published'
)
another_site_snippet_version = Version.objects.create(

Check failure on line 56 in tests/test_admin.py

View workflow job for this annotation

GitHub Actions / flake8

local variable 'another_site_snippet_version' is assigned to but never used
content=another_site_snippet,

Check warning on line 57 in tests/test_admin.py

View workflow job for this annotation

GitHub Actions / flake8

trailing whitespace
created_by=self.superuser,

Check warning on line 58 in tests/test_admin.py

View workflow job for this annotation

GitHub Actions / flake8

trailing whitespace
state='published'
)
queryset = self.snippet_admin.get_queryset(self.snippet_admin_request)
self.assertIn(current_site_snippet, queryset) # Test for snippet of current site
self.assertIn(self.snippet, queryset) # Test for snippet with no site
self.assertNotIn(another_site_snippet, queryset) # Test for snippet with another site
# Test for snippet of current site
self.assertIn(current_site_snippet, queryset)
# Test for snippet with no site
self.assertIn(self.snippet, queryset)
# Test for snippet with another site
self.assertNotIn(another_site_snippet, queryset)

@override_settings(DJANGOCMS_SNIPPET_VERSIONING_ENABLED=False)
def test_admin_list_display_without_versioning(self):
Expand Down

0 comments on commit acd053a

Please sign in to comment.