Django

Code

Ticket #7743 (closed: wontfix)

Opened 5 months ago

Last modified 3 months ago

Django uses "testserver" instead of "example.com" in assertRedirects tests

Reported by: jshaffer Assigned to: nobody
Milestone: Component: Testing framework
Version: SVN Keywords:
Cc: Triage Stage: Unreviewed
Has patch: 0 Needs documentation: 0
Needs tests: 0 Patch needs improvement: 0

Description

The default Site domain is "example.com". Redirects are different; I'm not sure why, but assertRedirects assumes a domain of "testserver". The domains should be made identical to avoid confusion. Note: this is only an issue when writing tests.

Attachments

Change History

07/18/08 18:50:34 changed by Simon Greenhill

  • status changed from new to closed.
  • needs_better_patch changed.
  • component changed from Uncategorized to Unit test system.
  • needs_tests changed.
  • summary changed from Django uses two different domains as defaults to Django uses "testserver" instead of "example.com" in assertRedirects tests.
  • needs_docs changed.
  • resolution set to invalid.

I believe it's because django.test.testcases.TestCase?.assertRedirects treats testserver differently?

08/25/08 07:31:11 changed by russellm

  • resolution changed from invalid to fixed.

(In [8535]) Fixed #7743: Reverted [8483], which was itself a reversion of [8481], after confirmation from Malcolm. Corrected a long standing mistake in the timesince/timeuntil filters when using a parameter for 'now'. Thanks to Andrew Shearer <ashearerw@shearersoftware.com> for the report.

08/25/08 07:38:06 changed by russellm

  • status changed from closed to reopened.
  • resolution deleted.

Oops - excuse the fat fingers. That last commit message should have referenced #7443.

08/25/08 10:52:28 changed by mtredinnick

  • status changed from reopened to closed.
  • resolution set to wontfix.

Was marked as "invalid" a while back, so I assume the reopening was just the normal "oops, I auto-closed the wrong ticket". This is really "wontfix", though, since (a) the test framework does treat testserver specially and (b) introducing any accidental confusion with the use of example.com in the user's code is worth avioding. It's very clear when you see "testserver" that it's something generated by the test framework. Finally, (c) the default value of the sites setting is pretty irrelevant here, since if you are using the sites framework, you will have changed the value anyway.


Add/Change #7743 (Django uses "testserver" instead of "example.com" in assertRedirects tests)




Change Properties
Action