Skip to content
This repository has been archived by the owner on Sep 18, 2022. It is now read-only.

test_project doesn't pass tests #74

Closed
pydanny opened this issue Jun 27, 2011 · 10 comments
Closed

test_project doesn't pass tests #74

pydanny opened this issue Jun 27, 2011 · 10 comments

Comments

@pydanny
Copy link
Owner

pydanny commented Jun 27, 2011

Stack trace of what I tried:

Creating test database 'default'...
Creating table auth_permission
Creating table auth_group_permissions
Creating table auth_group
Creating table auth_user_user_permissions
Creating table auth_user_groups
Creating table auth_user
Creating table auth_message
Creating table django_content_type
Creating table django_session
Creating table django_site
Installing index for auth.Permission model
Installing index for auth.Group_permissions model
Installing index for auth.User_user_permissions model
Installing index for auth.User_groups model
Installing index for auth.Message model
No fixtures found.
# .......EE...E.................................E..........E............
## ERROR: test_password_change_fails_with_invalid_old_password (django.contrib.auth.tests.views.ChangePasswordTest)

Traceback (most recent call last):
  File "/Library/Python/2.6/site-packages/django/contrib/auth/tests/views.py", line 147, in test_password_change_fails_with_invalid_old_password
    'new_password2': 'password1',
  File "/Library/Python/2.6/site-packages/django/test/client.py", line 322, in post
    response = self.request(*_r)
  File "/Library/Python/2.6/site-packages/django/core/handlers/base.py", line 100, in get_response
    response = callback(request, *callback_args, *_callback_kwargs)
  File "/Library/Python/2.6/site-packages/django/utils/decorators.py", line 76, in _wrapped_view
    response = view_func(request, _args, *_kwargs)
  File "/Library/Python/2.6/site-packages/django/contrib/auth/decorators.py", line 25, in _wrapped_view
    return view_func(request, _args, *_kwargs)
  File "/Library/Python/2.6/site-packages/django/contrib/auth/views.py", line 187, in password_change
    }, context_instance=RequestContext(request))
  File "/Library/Python/2.6/site-packages/django/shortcuts/__init__.py", line 20, in render_to_response
    return HttpResponse(loader.render_to_string(_args, *_kwargs), **httpresponse_kwargs)
  File "/Library/Python/2.6/site-packages/django/template/loader.py", line 181, in render_to_string
    t = get_template(template_name)
  File "/Library/Python/2.6/site-packages/django/template/loader.py", line 157, in get_template
    template, origin = find_template(template_name)
  File "/Library/Python/2.6/site-packages/django/template/loader.py", line 138, in find_template
    raise TemplateDoesNotExist(name)
TemplateDoesNotExist: registration/password_change_form.html
# 
## ERROR: test_password_change_fails_with_mismatched_passwords (django.contrib.auth.tests.views.ChangePasswordTest)

Traceback (most recent call last):
  File "/Library/Python/2.6/site-packages/django/contrib/auth/tests/views.py", line 158, in test_password_change_fails_with_mismatched_passwords
    'new_password2': 'donuts',
  File "/Library/Python/2.6/site-packages/django/test/client.py", line 322, in post
    response = self.request(*_r)
  File "/Library/Python/2.6/site-packages/django/core/handlers/base.py", line 100, in get_response
    response = callback(request, *callback_args, *_callback_kwargs)
  File "/Library/Python/2.6/site-packages/django/utils/decorators.py", line 76, in _wrapped_view
    response = view_func(request, _args, *_kwargs)
  File "/Library/Python/2.6/site-packages/django/contrib/auth/decorators.py", line 25, in _wrapped_view
    return view_func(request, _args, *_kwargs)
  File "/Library/Python/2.6/site-packages/django/contrib/auth/views.py", line 187, in password_change
    }, context_instance=RequestContext(request))
  File "/Library/Python/2.6/site-packages/django/shortcuts/__init__.py", line 20, in render_to_response
    return HttpResponse(loader.render_to_string(_args, *_kwargs), **httpresponse_kwargs)
  File "/Library/Python/2.6/site-packages/django/template/loader.py", line 181, in render_to_string
    t = get_template(template_name)
  File "/Library/Python/2.6/site-packages/django/template/loader.py", line 157, in get_template
    template, origin = find_template(template_name)
  File "/Library/Python/2.6/site-packages/django/template/loader.py", line 138, in find_template
    raise TemplateDoesNotExist(name)
TemplateDoesNotExist: registration/password_change_form.html
# 
## ERROR: Logout without next_page option renders the default template

Traceback (most recent call last):
  File "/Library/Python/2.6/site-packages/django/contrib/auth/tests/views.py", line 247, in test_logout_default
    response = self.client.get('/logout/')
  File "/Library/Python/2.6/site-packages/django/test/client.py", line 290, in get
    response = self.request(**r)
  File "/Library/Python/2.6/site-packages/django/test/client.py", line 230, in request
    response = self.handler(environ)
  File "/Library/Python/2.6/site-packages/django/test/client.py", line 74, in **call**
    response = self.get_response(request)
  File "/Library/Python/2.6/site-packages/django/core/handlers/base.py", line 142, in get_response
    return self.handle_uncaught_exception(request, resolver, exc_info)
  File "/Library/Python/2.6/site-packages/django/core/handlers/base.py", line 180, in handle_uncaught_exception
    callback, param_dict = resolver.resolve500()
  File "/Library/Python/2.6/site-packages/django/core/urlresolvers.py", line 262, in resolve500
    return self._resolve_special('500')
  File "/Library/Python/2.6/site-packages/django/core/urlresolvers.py", line 252, in _resolve_special
    callback = getattr(self.urlconf_module, 'handler%s' % view_type)
AttributeError: 'module' object has no attribute 'handler500'
# 
## ERROR: test_uni_form_setup (uni_form.tests.tests.TestBasicFunctionalityTags)

Traceback (most recent call last):
  File "/Users/pydanny/projects/django-uni-form/uni_form/tests/tests.py", line 83, in test_uni_form_setup
    html = template.render(c)
  File "/Library/Python/2.6/site-packages/django/template/**init**.py", line 173, in render
    return self._render(context)
  File "/Library/Python/2.6/site-packages/django/test/utils.py", line 29, in instrumented_test_render
    return self.nodelist.render(context)
  File "/Library/Python/2.6/site-packages/django/template/__init__.py", line 796, in render
    bits.append(self.render_node(node, context))
  File "/Library/Python/2.6/site-packages/django/template/debug.py", line 72, in render_node
    result = node.render(context)
  File "/Library/Python/2.6/site-packages/django/template/**init**.py", line 954, in render
    dict = func(*args)
  File "/Users/pydanny/projects/django-uni-form/uni_form/templatetags/uni_form_filters.py", line 72, in uni_form_setup
    context['STATIC_URL'] = settings.STATIC_URL
  File "/Library/Python/2.6/site-packages/django/utils/functional.py", line 277, in **getattr**
    return getattr(self._wrapped, name)
TemplateSyntaxError: Caught AttributeError while rendering: 'Settings' object has no attribute 'STATIC_URL'
# 
## ERROR: test_formset_layout (uni_form.tests.tests.TestFormLayout)

Traceback (most recent call last):
  File "/Users/pydanny/projects/django-uni-form/uni_form/tests/tests.py", line 478, in test_formset_layout
    self.assertTrue('action="%s"' % reverse('simpleAction') in html)
  File "/Library/Python/2.6/site-packages/django/core/urlresolvers.py", line 350, in reverse
    _args, *_kwargs)))
  File "/Library/Python/2.6/site-packages/django/core/urlresolvers.py", line 296, in reverse
    "arguments '%s' not found." % (lookup_view_s, args, kwargs))
NoReverseMatch: Reverse for 'simpleAction' with arguments '()' and keyword arguments '{}' not found.

---

Ran 70 tests in 2.663s

FAILED (errors=5)
Destroying test database 'default'...```
@venkasub
Copy link

/me got the test-project working in my fork.

@maraujop
Copy link
Collaborator

@pydanny I just reproduced your 5 errors, you forgot to mention you were using Django1.2, right? Using Django1.3 only 1 error prompts, related to urls.py

Major problem here is STATIC_URL and MEDIA_URL, that will likely make impossible to pass tests in both versions of Django. You know what I think of test_project :D

@venkasub
Copy link

the test-project's settings.py was crap!
Also, do we need to bundle this during setup?

@maraujop
Copy link
Collaborator

I'm discussing with @pydanny if test_project will stay around. I'm not a fan of test projects.

do we need to bundle this during setup?

I'm sorry but I don't understand your second question.

@maraujop
Copy link
Collaborator

Ok, so test_project has been dropped for 0.8.1, so I'm closing the issue.

@venkasub
Copy link

I dont think the test_project should be dropped. A demo project always helps a person to get on speed with things faster. People like me look at sample demo projects than reading the docs in evaluating an app.
Instead of dropping, there should be an effort to cleanse it. IMHO.

@pydanny
Copy link
Owner Author

pydanny commented Jun 28, 2011

You raise good points. Miguel's issue is maintaining it is a lot of work across multiple versions of Python and Django is a huge amount of work and he is right.

Which is why I plan to create a secondary project called django-uni-form-examples. And we'll link to it from the docs. :D

@pydanny
Copy link
Owner Author

pydanny commented Jun 28, 2011

Done: https://github.com/pydanny/django-uni-form-examples

It will have its own docs folder. And the example projects will be cleaner because the way I built the test_project was kind of gnarly. ;)

@maraujop
Copy link
Collaborator

@venkasub Well, examples are always a good thing, that's why @pydanny and I talked about adding more to the documentation.

I'm actually against test projects, unless they are necessary for building a testing suite, in those cases that you cannot have an isolated testing suite. For example, IMHO django-debug-toolbar would benefit from having one for testing.

Here are some of my reasons aa6b447

Also, there are projects out there that use them as an excuse for not having docs. We have docs, that are really good and are getting better everyday. They should be good enough so that you see how the app works, to let you evaluate if you need the concept it implements, etc.

@venkasub
Copy link

I am fine with the idea of having a separate examples project. Cool.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants