Opened 14 years ago

Closed 14 years ago

Last modified 13 years ago

#15554 closed (fixed)

Bad test in django.contrib.contenttypes.tests.ContentTypesTests

Reported by: Alexander Kaidalov Owned by: nobody
Component: Contrib apps Version: dev
Severity: Keywords: test
Cc: Triage Stage: Accepted
Has patch: yes Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no

Description

example.com is hardcoded in test_shortcut_view. We have fixture which changes site name, so this test failes:

Installing json fixture 'initial_data' from absolute path.
Installed 6 object(s) from 1 fixture(s)
.............................................................................F.............................................................................................................................
======================================================================
FAIL: test_shortcut_view (django.contrib.contenttypes.tests.ContentTypesTests)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/usr/local/lib/python2.6/dist-packages/django/contrib/contenttypes/tests.py", line 67, in test_shortcut_view
    self.assertEqual("http://example.com/users/john/", response._headers.get("location")[1])
AssertionError: 'http://example.com/users/john/' != 'http://test.ru/users/john/'

----------------------------------------------------------------------
Ran 203 tests in 2.574s

FAILED (failures=1)
Destroying test database 'default'...

Attachments (1)

sites_absolute_path_fix.diff (796 bytes ) - added by Paul McMillan 14 years ago.

Download all attachments as: .zip

Change History (6)

comment:1 by Paul McMillan, 14 years ago

milestone: 1.3
Triage Stage: UnreviewedAccepted

Looks reasonable to me.

by Paul McMillan, 14 years ago

comment:2 by Paul McMillan, 14 years ago

Has patch: set

I was able to reproduce this problem, and have attached a patch which fixes it.

comment:3 by Russell Keith-Magee, 14 years ago

Resolution: fixed
Status: newclosed

In [15766]:

Fixed #15554 -- Corrected test failure in contenttypes when default site isn't example.com. Thanks to twil for the report, and PaulM for the patch.

comment:4 by Russell Keith-Magee, 14 years ago

In [15767]:

[1.2.X] Fixed #15554 -- Corrected test failure in contenttypes when default site isn't example.com. Thanks to twil for the report, and PaulM for the patch.

Backport of r15766 from trunk.

comment:5 by Jacob, 13 years ago

milestone: 1.3

Milestone 1.3 deleted

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