Skip to content
Permalink
Browse files

Potentially fix #857 by not requiring coercing as integer and string …

…in cache key. Add test

Flake8: Ignore line-breaks around binary operators
  • Loading branch information
benjaoming committed Dec 30, 2019
1 parent 31503c8 commit dc377faace84a76310cb20920cd12573c9bb71c8
Showing with 11 additions and 2 deletions.
  1. +1 −1 setup.cfg
  2. +1 −1 src/wiki/models/article.py
  3. +9 −0 tests/core/test_managers.py
@@ -2,7 +2,7 @@
universal = 0

[flake8]
ignore = E501
ignore = E501 W503 W504
max-line-length = 160
max-complexity = 10
exclude = .svn,CVS,.bzr,.hg,.git,__pycache__,.tox,.eggs,*.egg,*/*migrations,testproject
@@ -204,7 +204,7 @@ def get_cache_key(self):
"""Returns per-article cache key."""
lang = translation.get_language()

return "wiki:article:{id:d}:{lang:s}".format(
return "wiki:article:{id}:{lang}".format(
id=self.current_revision.id if self.current_revision else self.id,
lang=lang)

@@ -22,6 +22,15 @@ def test_queryset_methods_directly_on_manager(self):
)
self.assertEqual(Article.objects.active().count(), 1)

def test_mass_deletion(self):
"""
https://github.com/django-wiki/django-wiki/issues/857
"""
Article.objects.all().delete()
self.assertEqual(
Article.objects.all().count(), 0
)

def test_queryset_methods_on_querysets(self):

self.assertEqual(

0 comments on commit dc377fa

Please sign in to comment.
You can’t perform that action at this time.