Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

Lots of tests are failing on initial `basic` installation #55

Closed
Vladimiroff opened this Issue · 3 comments

4 participants

@Vladimiroff

While on the zero project everything runs smooth, on basic setup there are failing tests right after initializing the project. It's kind of hard to be sure in your project when there are lots of fails and errors in the tests, right?

$ python manage.py test
Creating test database for alias 'default'...
...................................................................................................F....................................................................................................................................................................E............EEE..EEE.EE...FE.............................................................F....
======================================================================
ERROR: test_authenticated_password_change_view (pinax.apps.account.tests.test_change_password.ChangePasswordTest)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/kiril/workspace/pinax_advanced_text/env/local/lib/python2.7/site-packages/pinax/apps/account/tests/test_change_password.py", line 43, in test_authenticated_password_change_view
    response = self.client.post(reverse("acct_login"), data)
  File "/home/kiril/workspace/pinax_advanced_text/env/local/lib/python2.7/site-packages/django/test/client.py", line 449, in post
    response = super(Client, self).post(path, data=data, content_type=content_type, **extra)
  File "/home/kiril/workspace/pinax_advanced_text/env/local/lib/python2.7/site-packages/django/test/client.py", line 259, in post
    return self.request(**r)
  File "/home/kiril/workspace/pinax_advanced_text/env/local/lib/python2.7/site-packages/django/core/handlers/base.py", line 111, in get_response
    response = callback(request, *callback_args, **callback_kwargs)
  File "/home/kiril/workspace/pinax_advanced_text/env/local/lib/python2.7/site-packages/pinax/apps/account/views.py", line 73, in login
    fallback_url = reverse(settings.LOGIN_REDIRECT_URLNAME)
  File "/home/kiril/workspace/pinax_advanced_text/env/local/lib/python2.7/site-packages/django/core/urlresolvers.py", line 391, in reverse
    *args, **kwargs)))
  File "/home/kiril/workspace/pinax_advanced_text/env/local/lib/python2.7/site-packages/django/core/urlresolvers.py", line 337, in reverse
    "arguments '%s' not found." % (lookup_view_s, args, kwargs))
NoReverseMatch: Reverse for 'what_next' with arguments '()' and keyword arguments '{}' not found.

======================================================================
ERROR: testRecoverAccountBadUsername (django_openid.tests.auth_tests.AccountRecoveryTest)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/kiril/workspace/pinax_advanced_text/env/local/lib/python2.7/site-packages/django_openid/tests/auth_tests.py", line 132, in testRecoverAccountBadUsername
    response = self.client.get('/openid/recover/')
  File "/home/kiril/workspace/pinax_advanced_text/env/local/lib/python2.7/site-packages/django/test/client.py", line 439, in get
    response = super(Client, self).get(path, data=data, **extra)
  File "/home/kiril/workspace/pinax_advanced_text/env/local/lib/python2.7/site-packages/django/test/client.py", line 241, in get
    return self.request(**r)
  File "/home/kiril/workspace/pinax_advanced_text/env/local/lib/python2.7/site-packages/django/core/handlers/base.py", line 136, in get_response
    response = response.render()
  File "/home/kiril/workspace/pinax_advanced_text/env/local/lib/python2.7/site-packages/django/template/response.py", line 97, in render
    self._set_content(self.rendered_content)
  File "/home/kiril/workspace/pinax_advanced_text/env/local/lib/python2.7/site-packages/django/template/response.py", line 73, in rendered_content
    template = self.resolve_template(self.template_name)
  File "/home/kiril/workspace/pinax_advanced_text/env/local/lib/python2.7/site-packages/django/template/response.py", line 51, in resolve_template
    return loader.get_template(template)
  File "/home/kiril/workspace/pinax_advanced_text/env/local/lib/python2.7/site-packages/django/template/loader.py", line 157, in get_template
    template, origin = find_template(template_name)
  File "/home/kiril/workspace/pinax_advanced_text/env/local/lib/python2.7/site-packages/django/template/loader.py", line 138, in find_template
    raise TemplateDoesNotExist(name)
TemplateDoesNotExist: django_openid/recover.html

======================================================================
ERROR: testRecoverAccountByUsername (django_openid.tests.auth_tests.AccountRecoveryTest)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/kiril/workspace/pinax_advanced_text/env/local/lib/python2.7/site-packages/django_openid/tests/auth_tests.py", line 147, in testRecoverAccountByUsername
    'recover': 'noopenids'
  File "/home/kiril/workspace/pinax_advanced_text/env/local/lib/python2.7/site-packages/django/test/client.py", line 449, in post
    response = super(Client, self).post(path, data=data, content_type=content_type, **extra)
  File "/home/kiril/workspace/pinax_advanced_text/env/local/lib/python2.7/site-packages/django/test/client.py", line 259, in post
    return self.request(**r)
  File "/home/kiril/workspace/pinax_advanced_text/env/local/lib/python2.7/site-packages/django/core/handlers/base.py", line 111, in get_response
    response = callback(request, *callback_args, **callback_kwargs)
  File "/home/kiril/workspace/pinax_advanced_text/env/local/lib/python2.7/site-packages/django_openid/consumer.py", line 157, in __call__
    return router(request, path_override = rest_of_url)
  File "/home/kiril/workspace/pinax_advanced_text/env/local/lib/python2.7/site-packages/django_openid/utils.py", line 67, in __call__
    return self.handle(request, path_override)
  File "/home/kiril/workspace/pinax_advanced_text/env/local/lib/python2.7/site-packages/django_openid/utils.py", line 64, in handle
    return callback(request, *callback_args, **callback_kwargs)
  File "/home/kiril/workspace/pinax_advanced_text/env/local/lib/python2.7/site-packages/django_openid/auth.py", line 307, in do_recover
    self.send_recovery_email(request, user)
  File "/home/kiril/workspace/pinax_advanced_text/env/local/lib/python2.7/site-packages/django_openid/auth.py", line 391, in send_recovery_email
    'theuser': user,
  File "/home/kiril/workspace/pinax_advanced_text/env/local/lib/python2.7/site-packages/django/template/response.py", line 113, in _get_content
    raise ContentNotRenderedError('The response content must be rendered before it can be accessed.')
ContentNotRenderedError: The response content must be rendered before it can be accessed.

======================================================================
ERROR: testLoginWithPassword (django_openid.tests.auth_tests.AuthTest)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/kiril/workspace/pinax_advanced_text/env/local/lib/python2.7/site-packages/django_openid/tests/auth_tests.py", line 58, in testLoginWithPassword
    'password': 'incorrect-password',
  File "/home/kiril/workspace/pinax_advanced_text/env/local/lib/python2.7/site-packages/django/test/client.py", line 449, in post
    response = super(Client, self).post(path, data=data, content_type=content_type, **extra)
  File "/home/kiril/workspace/pinax_advanced_text/env/local/lib/python2.7/site-packages/django/test/client.py", line 259, in post
    return self.request(**r)
  File "/home/kiril/workspace/pinax_advanced_text/env/local/lib/python2.7/site-packages/django/core/handlers/base.py", line 136, in get_response
    response = response.render()
  File "/home/kiril/workspace/pinax_advanced_text/env/local/lib/python2.7/site-packages/django/template/response.py", line 97, in render
    self._set_content(self.rendered_content)
  File "/home/kiril/workspace/pinax_advanced_text/env/local/lib/python2.7/site-packages/django/template/response.py", line 73, in rendered_content
    template = self.resolve_template(self.template_name)
  File "/home/kiril/workspace/pinax_advanced_text/env/local/lib/python2.7/site-packages/django/template/response.py", line 51, in resolve_template
    return loader.get_template(template)
  File "/home/kiril/workspace/pinax_advanced_text/env/local/lib/python2.7/site-packages/django/template/loader.py", line 157, in get_template
    template, origin = find_template(template_name)
  File "/home/kiril/workspace/pinax_advanced_text/env/local/lib/python2.7/site-packages/django/template/loader.py", line 138, in find_template
    raise TemplateDoesNotExist(name)
TemplateDoesNotExist: django_openid/login_plus_password.html

======================================================================
ERROR: testLoginCancel (django_openid.tests.consumer_tests.ConsumerTest)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/kiril/workspace/pinax_advanced_text/env/local/lib/python2.7/site-packages/django_openid/tests/consumer_tests.py", line 83, in testLoginCancel
    openid_consumer.request_cancelled_message in response.content
  File "/home/kiril/workspace/pinax_advanced_text/env/local/lib/python2.7/site-packages/django/template/response.py", line 113, in _get_content
    raise ContentNotRenderedError('The response content must be rendered before it can be accessed.')
ContentNotRenderedError: The response content must be rendered before it can be accessed.

======================================================================
ERROR: testLoginDiscoverFail (django_openid.tests.consumer_tests.ConsumerTest)
E.g. the user enters an invalid URL
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/kiril/workspace/pinax_advanced_text/env/local/lib/python2.7/site-packages/django_openid/tests/consumer_tests.py", line 42, in testLoginDiscoverFail
    self.assert_(openid_consumer.openid_invalid_message in str(response))
  File "/home/kiril/workspace/pinax_advanced_text/env/local/lib/python2.7/site-packages/django/http/__init__.py", line 515, in __str__
    + '\n\n' + self.content
  File "/home/kiril/workspace/pinax_advanced_text/env/local/lib/python2.7/site-packages/django/template/response.py", line 113, in _get_content
    raise ContentNotRenderedError('The response content must be rendered before it can be accessed.')
ContentNotRenderedError: The response content must be rendered before it can be accessed.

======================================================================
ERROR: testLoginFailure (django_openid.tests.consumer_tests.ConsumerTest)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/kiril/workspace/pinax_advanced_text/env/local/lib/python2.7/site-packages/django_openid/tests/consumer_tests.py", line 95, in testLoginFailure
    self.assert_('Failure: ' in response.content)
  File "/home/kiril/workspace/pinax_advanced_text/env/local/lib/python2.7/site-packages/django/template/response.py", line 113, in _get_content
    raise ContentNotRenderedError('The response content must be rendered before it can be accessed.')
ContentNotRenderedError: The response content must be rendered before it can be accessed.

======================================================================
ERROR: testLoginSetupNeeded (django_openid.tests.consumer_tests.ConsumerTest)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/kiril/workspace/pinax_advanced_text/env/local/lib/python2.7/site-packages/django_openid/tests/consumer_tests.py", line 106, in testLoginSetupNeeded
    self.assert_(openid_consumer.setup_needed_message in response.content)
  File "/home/kiril/workspace/pinax_advanced_text/env/local/lib/python2.7/site-packages/django/template/response.py", line 113, in _get_content
    raise ContentNotRenderedError('The response content must be rendered before it can be accessed.')
ContentNotRenderedError: The response content must be rendered before it can be accessed.

======================================================================
ERROR: testLoginSuccess (django_openid.tests.consumer_tests.ConsumerTest)
Simulate a successful login
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/kiril/workspace/pinax_advanced_text/env/local/lib/python2.7/site-packages/django_openid/tests/consumer_tests.py", line 55, in testLoginSuccess
    'You logged in as http://simonwillison.net/' in response.content
  File "/home/kiril/workspace/pinax_advanced_text/env/local/lib/python2.7/site-packages/django/template/response.py", line 113, in _get_content
    raise ContentNotRenderedError('The response content must be rendered before it can be accessed.')
ContentNotRenderedError: The response content must be rendered before it can be accessed.

======================================================================
ERROR: testRegisterWithPassword (django_openid.tests.auth_tests.RegistrationTest)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/kiril/workspace/pinax_advanced_text/env/local/lib/python2.7/site-packages/django_openid/tests/auth_tests.py", line 95, in testRegisterWithPassword
    'password2': 'password',
  File "/home/kiril/workspace/pinax_advanced_text/env/local/lib/python2.7/site-packages/django/test/client.py", line 449, in post
    response = super(Client, self).post(path, data=data, content_type=content_type, **extra)
  File "/home/kiril/workspace/pinax_advanced_text/env/local/lib/python2.7/site-packages/django/test/client.py", line 259, in post
    return self.request(**r)
  File "/home/kiril/workspace/pinax_advanced_text/env/local/lib/python2.7/site-packages/django/core/handlers/base.py", line 111, in get_response
    response = callback(request, *callback_args, **callback_kwargs)
  File "/home/kiril/workspace/pinax_advanced_text/env/local/lib/python2.7/site-packages/django_openid/consumer.py", line 157, in __call__
    return router(request, path_override = rest_of_url)
  File "/home/kiril/workspace/pinax_advanced_text/env/local/lib/python2.7/site-packages/django_openid/utils.py", line 67, in __call__
    return self.handle(request, path_override)
  File "/home/kiril/workspace/pinax_advanced_text/env/local/lib/python2.7/site-packages/django_openid/utils.py", line 64, in handle
    return callback(request, *callback_args, **callback_kwargs)
  File "/home/kiril/workspace/pinax_advanced_text/env/local/lib/python2.7/site-packages/django_openid/registration.py", line 155, in do_register
    return self.confirm_email_step(request, user)
  File "/home/kiril/workspace/pinax_advanced_text/env/local/lib/python2.7/site-packages/django_openid/registration.py", line 182, in confirm_email_step
    self.send_confirm_email(request, user)
  File "/home/kiril/workspace/pinax_advanced_text/env/local/lib/python2.7/site-packages/django_openid/registration.py", line 202, in send_confirm_email
    'newuser': user,
  File "/home/kiril/workspace/pinax_advanced_text/env/local/lib/python2.7/site-packages/django/template/response.py", line 113, in _get_content
    raise ContentNotRenderedError('The response content must be rendered before it can be accessed.')
ContentNotRenderedError: The response content must be rendered before it can be accessed.

======================================================================
FAIL: test_shortcut_view (django.contrib.contenttypes.tests.ContentTypesTests)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/kiril/workspace/pinax_advanced_text/env/local/lib/python2.7/site-packages/django/contrib/contenttypes/tests.py", line 70, in test_shortcut_view
    response._headers.get("location")[1])
AssertionError: u'http://example.com/users/john/' != 'http://example.com/profiles/profile/john/'

======================================================================
FAIL: testInvalidRegistrationWithPassword (django_openid.tests.auth_tests.RegistrationTest)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/kiril/workspace/pinax_advanced_text/env/local/lib/python2.7/site-packages/django_openid/tests/auth_tests.py", line 84, in testInvalidRegistrationWithPassword
    'User with this Username already exists' in str(response)
AssertionError: False is not true

======================================================================
FAIL: tests (pagination)
Doctest: pagination.tests
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/kiril/workspace/pinax_advanced_text/env/local/lib/python2.7/site-packages/django/test/_doctest.py", line 2180, in runTest
    raise self.failureException(self.format_failure(new.getvalue()))
AssertionError: Failed doctest test for pagination.tests
  File "/home/kiril/workspace/pinax_advanced_text/env/local/lib/python2.7/site-packages/pagination/tests.py", line 0, in tests

----------------------------------------------------------------------
File "/home/kiril/workspace/pinax_advanced_text/env/local/lib/python2.7/site-packages/pagination/tests.py", line 65, in pagination.tests
Failed example:
    t.render(Context({'var': range(21), 'request': HttpRequest()}))
Expected:
    u'\n\n<div class="pagination">...
Got:
    u'\n\n\n<div class="pagination">\n    <ul>\n        \n            <li class="prev disabled"><a>\u2190 Previous</a></li>\n        \n        \n            \n                <li class="active"><a href="?page=1">1</a></li>\n            \n        \n            \n                <li class=""><a href="?page=2">2</a></li>\n            \n        \n            \n                <li class=""><a href="?page=3">3</a></li>\n            \n        \n            \n                <li class=""><a href="?page=4">4</a></li>\n            \n        \n            \n                <li class="disabled"><a href="#">\u2026</a></li>\n            \n        \n            \n                <li class=""><a href="?page=8">8</a></li>\n            \n        \n            \n                <li class=""><a href="?page=9">9</a></li>\n            \n        \n            \n                <li class=""><a href="?page=10">10</a></li>\n            \n        \n            \n                <li class=""><a href="?page=11">11</a></li>\n            \n        \n        \n            <li class="next"><a href="?page=2">Next \u2192</a></li>\n        \n    </ul>\n</div>\n'
----------------------------------------------------------------------
File "/home/kiril/workspace/pinax_advanced_text/env/local/lib/python2.7/site-packages/pagination/tests.py", line 69, in pagination.tests
Failed example:
    t.render(Context({'var': range(21), 'request': HttpRequest()}))
Expected:
    u'\n\n<div class="pagination">...
Got:
    u'\n\n\n<div class="pagination">\n    <ul>\n        \n            <li class="prev disabled"><a>\u2190 Previous</a></li>\n        \n        \n            \n                <li class="active"><a href="?page=1">1</a></li>\n            \n        \n            \n                <li class=""><a href="?page=2">2</a></li>\n            \n        \n        \n            <li class="next"><a href="?page=2">Next \u2192</a></li>\n        \n    </ul>\n</div>\n'
----------------------------------------------------------------------
File "/home/kiril/workspace/pinax_advanced_text/env/local/lib/python2.7/site-packages/pagination/tests.py", line 72, in pagination.tests
Failed example:
    t.render(Context({'var': range(21), 'request': HttpRequest()}))
Expected:
    u'\n\n<div class="pagination">...
Got:
    u'\n\n\n<div class="pagination">\n    <ul>\n        \n            <li class="prev disabled"><a>\u2190 Previous</a></li>\n        \n        \n            \n                <li class="active"><a href="?page=1">1</a></li>\n            \n        \n            \n                <li class=""><a href="?page=2">2</a></li>\n            \n        \n        \n            <li class="next"><a href="?page=2">Next \u2192</a></li>\n        \n    </ul>\n</div>\n'
----------------------------------------------------------------------
File "/home/kiril/workspace/pinax_advanced_text/env/local/lib/python2.7/site-packages/pagination/tests.py", line 75, in pagination.tests
Failed example:
    t.render(Context({'var': range(21), 'by': 20, 'request': HttpRequest()}))
Expected:
    u'\n\n<div class="pagination">...
Got:
    u'\n\n\n<div class="pagination">\n    <ul>\n        \n            <li class="prev disabled"><a>\u2190 Previous</a></li>\n        \n        \n            \n                <li class="active"><a href="?page=1">1</a></li>\n            \n        \n            \n                <li class=""><a href="?page=2">2</a></li>\n            \n        \n        \n            <li class="next"><a href="?page=2">Next \u2192</a></li>\n        \n    </ul>\n</div>\n'


----------------------------------------------------------------------
Ran 359 tests in 11.712s

FAILED (failures=3, errors=10)
Destroying test database for alias 'default'...
@dgrtwo

I've been bothered by this as well

@jondbaker

On a fresh 'account' project I also get:

======================================================================
FAIL: testInvalidRegistrationWithPassword (django_openid.tests.auth_tests.RegistrationTest)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/kiril/workspace/pinax_advanced_text/env/local/lib/python2.7/site-packages/django_openid/tests/auth_tests.py", line 84, in testInvalidRegistrationWithPassword
    'User with this Username already exists' in str(response)
AssertionError: False is not true
@Vladimiroff

Well, the good news is that most of the failing tests are in django-openid, which I remove after creating the new project, anyway.

But still, these tests are kind of a blocker for me to use Pinax for real projects.

@paltman paltman closed this
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.