django-cms / django-classy-tags

Class based template tags for django

Home Page:http://django-classy-tags.rtfd.org

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

3.0.1: 17 failing tests with TemplateSyntaxError

dvzrv opened this issue · comments

Hi! When trying to rebuild django-classy-tags for the removal of the python setup.py test use, I ran into 17 failing tests, e.g.:

======================================================================
ERROR: test_too_many_arguments (tests.test_core.ClassytagsTests)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/usr/lib/python3.10/site-packages/django/template/base.py", line 505, in parse
    compile_func = self.tags[command]
KeyError: 'no_arg'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/build/python-django-classy-tags/src/django-classy-tags-3.0.1/tests/test_core.py", line 836, in test_too_many_arguments
    self.assertRaises(exceptions.TooManyArguments,
  File "/usr/lib/python3.10/unittest/case.py", line 738, in assertRaises
    return context.handle('assertRaises', args, kwargs)
  File "/usr/lib/python3.10/unittest/case.py", line 201, in handle
    callable_obj(*args, **kwargs)
  File "/usr/lib/python3.10/site-packages/django/template/base.py", line 154, in __init__
    self.nodelist = self.compile_nodelist()
  File "/usr/lib/python3.10/site-packages/django/template/base.py", line 200, in compile_nodelist
    return parser.parse()
  File "/usr/lib/python3.10/site-packages/django/template/base.py", line 507, in parse
    self.invalid_block_tag(token, command, parse_until)
  File "/usr/lib/python3.10/site-packages/django/template/base.py", line 568, in invalid_block_tag
    raise self.error(
django.template.exceptions.TemplateSyntaxError: Invalid block tag on line 1: 'no_arg'. Did you forget to register or load this tag?

======================================================================
FAIL: test_naming (tests.test_core.ClassytagsTests)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/build/python-django-classy-tags/src/django-classy-tags-3.0.1/tests/test_core.py", line 570, in test_naming
    self.assertTrue('my_tag' in lib.tags, msg)
AssertionError: False is not true : 'my_tag' not in dict_keys(['MyTag'])

----------------------------------------------------------------------
Ran 72 tests in 0.009s

python-django-classy-tags-3.0.1-2-x86_64-check.log

This is with django 4.1.3 FWIW.

Backporting the changes in 8e12542 fixes this issue with django >= 4.1

Releasing those changes in a new version would be really great! :)

@dvzrv Thanks for the reminder.

I've just released 4.0 with support for django 4.1 and python 3.11