Opened 13 years ago

Closed 13 years ago

Last modified 13 years ago

#14935 closed (fixed)

admin_views regression test has one failure since r14992

Reported by: Ramiro Morales Owned by: nobody
Component: contrib.admin 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

Output is:

ERROR: test_recentactions_without_content_type (regressiontests.admin_views.tests.AdminViewStringPrimaryKeyTest)
If a LogEntry is missing content_type it will not display it in span tag under the hyperlink.
----------------------------------------------------------------------
Traceback (most recent call last):
  File "tests/regressiontests/admin_views/tests.py", line 960, in test_recentactions_without_content_type
    response = self.client.get('/test_admin/admin/')
  File "django/test/client.py", line 434, in get
    response = super(Client, self).get(path, data=data, **extra)
  File "django/test/client.py", line 218, in get
    return self.request(**r)
  File "django/test/client.py", line 376, in request
    response = self.handler(environ)
  File "django/test/client.py", line 83, in __call__
    response = self.get_response(request)
  File "django/core/handlers/base.py", line 162, in get_response
    response = self.handle_uncaught_exception(request, resolver, sys.exc_info())
  File "django/core/handlers/base.py", line 209, in handle_uncaught_exception
    'request':request
  File "/usr/lib/python2.6/logging/__init__.py", line 1082, in error
    self._log(ERROR, msg, args, **kwargs)
  File "/usr/lib/python2.6/logging/__init__.py", line 1173, in _log
    self.handle(record)
  File "/usr/lib/python2.6/logging/__init__.py", line 1183, in handle
    self.callHandlers(record)
  File "/usr/lib/python2.6/logging/__init__.py", line 1220, in callHandlers
    hdlr.handle(record)
  File "/usr/lib/python2.6/logging/__init__.py", line 679, in handle
    self.emit(record)
  File "django/utils/log.py", line 91, in emit
    html_message = reporter.get_traceback_html()
  File "django/views/debug.py", line 140, in get_traceback_html
    return t.render(c)
  File "django/template/base.py", line 123, in render
    return self._render(context)
  File "django/test/utils.py", line 57, in instrumented_test_render
    return self.nodelist.render(context)
  File "django/template/base.py", line 744, in render
    bits.append(self.render_node(node, context))
  File "django/template/base.py", line 757, in render_node
    return node.render(context)
  File "django/template/defaulttags.py", line 76, in render
    output = self.nodelist.render(context)
  File "django/template/base.py", line 744, in render
    bits.append(self.render_node(node, context))
  File "django/template/base.py", line 757, in render_node
    return node.render(context)
  File "django/template/defaulttags.py", line 227, in render
    nodelist.append(node.render(context))
  File "django/template/defaulttags.py", line 311, in render
    return self.nodelist_true.render(context)
  File "django/template/base.py", line 744, in render
    bits.append(self.render_node(node, context))
  File "django/template/base.py", line 757, in render_node
    return node.render(context)
  File "django/template/defaulttags.py", line 227, in render
    nodelist.append(node.render(context))
  File "django/template/base.py", line 792, in render
    output = self.filter_expression.resolve(context)
  File "django/template/base.py", line 510, in resolve
    obj = self.var.resolve(context)
  File "django/template/base.py", line 653, in resolve
    value = self._resolve_lookup(context)
  File "django/template/base.py", line 698, in _resolve_lookup
    current = current()
  File "django/contrib/admin/models.py", line 54, in get_admin_url
    return mark_safe(u"%s/%s/%s/" % (self.content_type.app_label, self.content_type.model, quote(self.object_id)))
AttributeError: 'NoneType' object has no attribute 'app_label'

----------------------------------------------------------------------
Ran 3292 tests in 270.181s

FAILED (errors=1, skipped=53, expected failures=2)
Destroying test database for alias 'default'...
Destroying test database for alias 'other'...

Change History (2)

comment:1 by Russell Keith-Magee, 13 years ago

Resolution: fixed
Status: newclosed

(In [15024]) Fixed #14935 -- Corrected a test failure introduced by r14992, which revealed an unhandled edge case in LogEntry handling in the admin. Thanks to Ramiro Morales for the report.

comment:2 by Jacob, 13 years ago

milestone: 1.3

Milestone 1.3 deleted

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