Opened 4 years ago

Closed 4 years ago

Last modified 3 years ago

#15554 closed (fixed)

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

Reported by: twil 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 PaulM 4 years ago.

Download all attachments as: .zip

Change History (6)

comment:1 Changed 4 years ago by PaulM

  • milestone set to 1.3
  • Needs documentation unset
  • Needs tests unset
  • Patch needs improvement unset
  • Triage Stage changed from Unreviewed to Accepted

Looks reasonable to me.

Changed 4 years ago by PaulM

comment:2 Changed 4 years ago by PaulM

  • Has patch set

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

comment:3 Changed 4 years ago by russellm

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

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 4 years ago by russellm

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

  • milestone 1.3 deleted

Milestone 1.3 deleted

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