Opened 16 years ago

Closed 16 years ago

#7743 closed (wontfix)

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

Reported by: John Shaffer Owned by: nobody
Component: Testing framework Version: dev
Severity: Keywords:
Cc: Triage Stage: Unreviewed
Has patch: no Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no

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.

Change History (4)

comment:1 by Simon Greenhill, 16 years ago

Component: UncategorizedUnit test system
Resolution: invalid
Status: newclosed
Summary: Django uses two different domains as defaultsDjango uses "testserver" instead of "example.com" in assertRedirects tests

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

comment:2 by Russell Keith-Magee, 16 years ago

Resolution: invalidfixed

(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@…> for the report.

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

Resolution: fixed
Status: closedreopened

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

comment:4 by Malcolm Tredinnick, 16 years ago

Resolution: wontfix
Status: reopenedclosed

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.

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