Skip to content

Commit

Permalink
assertCountEqual is defined in django.utils.six as a Python 2/3 fallb…
Browse files Browse the repository at this point in the history
…ack.
  • Loading branch information
atombrella authored and benjaoming committed Nov 17, 2017
1 parent 956907d commit 2ff3fc4
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 14 deletions.
1 change: 1 addition & 0 deletions src/wiki/core/plugins/registry.py
Expand Up @@ -87,6 +87,7 @@ def get_html_whitelist():
"""Returns additional html tags that should be whitelisted"""
return _html_whitelist


def get_html_attributes():
"""Returns additional html attributes that should be whitelisted"""
return _html_attributes
17 changes: 3 additions & 14 deletions tests/core/test_template_tags.py
Expand Up @@ -7,7 +7,8 @@
from django.conf import settings as django_settings
from django.contrib.contenttypes.models import ContentType
from django.http import HttpRequest
from six import PY3
from django.utils.six import assertCountEqual

from wiki.conf import settings
from wiki.forms import CreateRootForm
from wiki.models import Article, ArticleForObject, ArticleRevision
Expand All @@ -19,17 +20,6 @@
django_settings.configure()


# copypasted from SIX source for tox tests compatebility reason.
if PY3:
_assertCountEqual = "assertCountEqual"
else:
_assertCountEqual = "assertItemsEqual"


def assertCountEqual(self, *args, **kwargs):
return getattr(self, _assertCountEqual)(*args, **kwargs)


# XXX article_for_object accepts context, but not using it
class ArticleForObjectTemplatetagTest(TemplateTestCase):

Expand Down Expand Up @@ -194,8 +184,7 @@ def test_if_preview_content_is_none(self):
# Additional check
self.render({'article': article, 'pc': None})

def test_called_with_preview_content_and_article_have_current_revision(
self):
def test_called_with_preview_content_and_article_have_current_revision(self):

article = Article.objects.create()
ArticleRevision.objects.create(
Expand Down

0 comments on commit 2ff3fc4

Please sign in to comment.