Code

Opened 3 years ago

Closed 3 years ago

Last modified 3 years ago

#14935 closed (fixed)

admin_views regression test has one failure since r14992

Reported by: ramiro Owned by: nobody
Component: contrib.admin Version: master
Severity: Keywords:
Cc: Triage Stage: Unreviewed
Has patch: no Needs documentation:
Needs tests: Patch needs improvement:
Easy pickings: UI/UX:

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'...

Attachments (0)

Change History (2)

comment:1 Changed 3 years ago by russellm

  • Resolution set to fixed
  • Status changed from new to closed

(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 Changed 3 years ago by jacob

  • milestone 1.3 deleted

Milestone 1.3 deleted

Add Comment

Modify Ticket

Change Properties
<Author field>
Action
as closed
as The resolution will be set. Next status will be 'closed'
The resolution will be deleted. Next status will be 'new'
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.