Skip to content

Loading…

Various Tests fail. #18

Open
unapiedra opened this Issue · 3 comments

3 participants

@unapiedra

Test for basic.blog fail. Note: The system works on the runserver. I haven't seen any issues with it yet. But the tests don't pass.

I am posting this here, in the knowledge that the information might not be enough. I am willing to provide more if you tell me what's needed. Could you, please, let me know if this is error is reproducable on other machines/installations?

FAIL: Doctest: basic.blog.tests

Traceback (most recent call last):
File "/usr/local/lib/python2.6/dist-packages/django/test/_doctest.py", line 2180, in runTest
raise self.failureException(self.format_failure(new.getvalue()))
AssertionError: Failed doctest test for basic.blog.tests
File "/home/chris/devel/project_p/basic/blog/tests.py", line 0, in tests


File "/home/chris/devel/project_p/basic/blog/tests.py", line 46, in basic.blog.tests
Failed example:
response = client.get(reverse('blog_search'), {'q': 'DJ'})
Exception raised:
Traceback (most recent call last):
File "/usr/local/lib/python2.6/dist-packages/django/test/_doctest.py", line 1267, in __run
compileflags, 1) in test.globs
File "", line 1, in
response = client.get(reverse('blog_search'), {'q': 'DJ'})
File "/usr/local/lib/python2.6/dist-packages/django/test/client.py", line 290, in get
response = self.request(*r)
File "/usr/local/lib/python2.6/dist-packages/django/core/handlers/base.py", line 100, in get_response
response = callback(request, *callback_args, *
callback_kwargs)
File "/home/chris/devel/project_p/basic/blog/views.py", line 166, in search
stop_word_list = re.compile(STOP_WORDS_RE, re.IGNORECASE)
File "/usr/lib/python2.6/re.py", line 190, in compile
return _compile(pattern, flags)
File "/usr/lib/python2.6/re.py", line 238, in _compile
raise ValueError('Cannot process flags argument with a compiled pattern')

ValueError: Cannot process flags argument with a compiled pattern

File "/home/chris/devel/project_p/basic/blog/tests.py", line 47, in basic.blog.tests
Failed example:
response.context[0]['object_list']
Exception raised:
Traceback (most recent call last):
File "/usr/local/lib/python2.6/dist-packages/django/test/doctest.py", line 1267, in __run
compileflags, 1) in test.globs
File "", line 1, in
response.context[0]['object_list']
File "/usr/local/lib/python2.6/dist-packages/django/template/context.py", line 46, in __getitem_

raise KeyError(key)

KeyError: 'object_list'

File "/home/chris/devel/project_p/basic/blog/tests.py", line 51, in basic.blog.tests
Failed example:
response = client.get(reverse('blog_search'), {'q': 'Holy'})
Exception raised:
Traceback (most recent call last):
File "/usr/local/lib/python2.6/dist-packages/django/test/_doctest.py", line 1267, in __run
compileflags, 1) in test.globs
File "", line 1, in
response = client.get(reverse('blog_search'), {'q': 'Holy'})
File "/usr/local/lib/python2.6/dist-packages/django/test/client.py", line 290, in get
response = self.request(*r)
File "/usr/local/lib/python2.6/dist-packages/django/core/handlers/base.py", line 100, in get_response
response = callback(request, *callback_args, *
callback_kwargs)
File "/home/chris/devel/project_p/basic/blog/views.py", line 166, in search
stop_word_list = re.compile(STOP_WORDS_RE, re.IGNORECASE)
File "/usr/lib/python2.6/re.py", line 190, in compile
return _compile(pattern, flags)
File "/usr/lib/python2.6/re.py", line 238, in _compile
raise ValueError('Cannot process flags argument with a compiled pattern')

ValueError: Cannot process flags argument with a compiled pattern

File "/home/chris/devel/project_p/basic/blog/tests.py", line 52, in basic.blog.tests
Failed example:
response.context[0]['object_list']
Exception raised:
Traceback (most recent call last):
File "/usr/local/lib/python2.6/dist-packages/django/test/doctest.py", line 1267, in __run
compileflags, 1) in test.globs
File "", line 1, in
response.context[0]['object_list']
File "/usr/local/lib/python2.6/dist-packages/django/template/context.py", line 46, in __getitem_

raise KeyError(key)

KeyError: 'object_list'

File "/home/chris/devel/project_p/basic/blog/tests.py", line 56, in basic.blog.tests
Failed example:
response = client.get(reverse('blog_search'), {'q': ''})
Exception raised:
Traceback (most recent call last):
File "/usr/local/lib/python2.6/dist-packages/django/test/_doctest.py", line 1267, in __run
compileflags, 1) in test.globs
File "", line 1, in
response = client.get(reverse('blog_search'), {'q': ''})
File "/usr/local/lib/python2.6/dist-packages/django/test/client.py", line 290, in get
response = self.request(*r)
File "/usr/local/lib/python2.6/dist-packages/django/core/handlers/base.py", line 100, in get_response
response = callback(request, *callback_args, *
callback_kwargs)
File "/home/chris/devel/project_p/basic/blog/views.py", line 166, in search
stop_word_list = re.compile(STOP_WORDS_RE, re.IGNORECASE)
File "/usr/lib/python2.6/re.py", line 190, in compile
return _compile(pattern, flags)
File "/usr/lib/python2.6/re.py", line 238, in _compile
raise ValueError('Cannot process flags argument with a compiled pattern')

ValueError: Cannot process flags argument with a compiled pattern

File "/home/chris/devel/project_p/basic/blog/tests.py", line 57, in basic.blog.tests
Failed example:
response.context[0]['message']
Exception raised:
Traceback (most recent call last):
File "/usr/local/lib/python2.6/dist-packages/django/test/doctest.py", line 1267, in __run
compileflags, 1) in test.globs
File "", line 1, in
response.context[0]['message']
File "/usr/local/lib/python2.6/dist-packages/django/template/context.py", line 46, in __getitem_

raise KeyError(key)
KeyError: 'message'


@stevejalim

Do you have 'basic.inlines' in your settings.INSTALLED_APPS? That'll fix at least some of these fails

@unapiedra

'basic.inlines' has always been part of INSTALLED_APPS.

@rolo

This was caused by a small bug whereby a regex was being compiled twice. I've fixed this and sent a pull request. #27

Or the fix is at https://github.com/rolo/django-basic-apps

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.