Opened 6 years ago

Closed 6 years ago

Last modified 5 years ago

#15554 closed (fixed)

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

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

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 6 years ago.

Download all attachments as: .zip

Change History (6)

comment:1 Changed 6 years ago by Paul McMillan

milestone: 1.3
Needs documentation: unset
Needs tests: unset
Patch needs improvement: unset
Triage Stage: UnreviewedAccepted

Looks reasonable to me.

Changed 6 years ago by Paul McMillan

comment:2 Changed 6 years ago by Paul McMillan

Has patch: set

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

comment:3 Changed 6 years ago by Russell Keith-Magee

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 Changed 6 years ago by Russell Keith-Magee

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 Changed 5 years ago by Jacob

milestone: 1.3

Milestone 1.3 deleted

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