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 , 16 years ago
Component: | Uncategorized → Unit test system |
---|---|
Resolution: | → invalid |
Status: | new → closed |
Summary: | Django uses two different domains as defaults → Django uses "testserver" instead of "example.com" in assertRedirects tests |
comment:2 by , 16 years ago
Resolution: | invalid → fixed |
---|
comment:3 by , 16 years ago
Resolution: | fixed |
---|---|
Status: | closed → reopened |
Oops - excuse the fat fingers. That last commit message should have referenced #7443.
comment:4 by , 16 years ago
Resolution: | → wontfix |
---|---|
Status: | reopened → closed |
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.
I believe it's because django.test.testcases.TestCase.assertRedirects treats
testserver
differently?