Opened 17 years ago

Last modified 17 years ago

#4700 closed

urlresolvers.get_callable fails in case of running tests — at Version 3

Reported by: anonymous Owned by: Adrian Holovaty
Component: Core (Other) Version: dev
Severity: Keywords:
Cc: Triage Stage: Unreviewed
Has patch: no Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no

Description (last modified by Malcolm Tredinnick)

urlresolvers.get_callable is raising an exception in "manage.py test" mode for any {% url %} tag:

    self.reverse_dict[pattern.callback] = (pattern,)
  File "/Users/phausel/site-packages/django/core/urlresolvers.py", line 152, in _get_callback
    self._callback = get_callable(self._callback_str)
  File "/Users/phausel/site-packages/django/utils/functional.py", line 16, in wrapper
    result = func(*args)
  File "/Users/phausel/site-packages/django/core/urlresolvers.py", line 29, in get_callable
    lookup_view = getattr(__import__(mod_name, {}, {}, ['']), func_name)
  File "/Users/phausel/site-packages/django/contrib/admin/views/doc.py", line 291, in <module>
    'AutoField'                 : _('Integer'),
TypeError: 'str' object is not callable

(The weird thing is that it occurs only when running the built in test feature.)

I printed out func_name which was template_detail (from django/contrib/admin/views)

Change History (3)

comment:1 by anonymous, 17 years ago

sorry, I forgot to mention: get_callable is a brand new feature, it was introduced just on 06/23/07 (to resolve #4566)

comment:2 by anonymous, 17 years ago

the error goes away if django.contrib.admin is not included in urls.py

comment:3 by Malcolm Tredinnick, 17 years ago

Description: modified (diff)

Unbroke description.

Note: See TracTickets for help on using tickets.
Back to Top