[Django] #23929: More tests for create_default_site

19 views
Skip to first unread message

Django

unread,
Nov 28, 2014, 11:43:36 AM11/28/14
to django-...@googlegroups.com
#23929: More tests for create_default_site
-------------------------------+--------------------
Reporter: wrwrwr | Owner: nobody
Type: New feature | Status: new
Component: contrib.sites | Version: master
Severity: Normal | Keywords:
Triage Stage: Unreviewed | Has patch: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------+--------------------
There are some aspects of the `sites.management.create_default_site`
handler that lack proper testing.

Tickets introducing or related to various pieces of it are: #7514, #15346,
#15573, #16353, #16828, #17415 (the last one includes a test).

--
Ticket URL: <https://code.djangoproject.com/ticket/23929>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.

Django

unread,
Nov 28, 2014, 12:17:33 PM11/28/14
to django-...@googlegroups.com
#23929: More tests for create_default_site
-------------------------------+--------------------------------------

Reporter: wrwrwr | Owner: nobody
Type: New feature | Status: new
Component: contrib.sites | Version: master
Severity: Normal | Resolution:
Keywords: | Triage Stage: Unreviewed
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 1

Easy pickings: 0 | UI/UX: 0
-------------------------------+--------------------------------------
Changes (by wrwrwr):

* needs_better_patch: => 1
* has_patch: 0 => 1
* needs_tests: => 0
* needs_docs: => 0


Comment:

The patch by ticket (some guessing about the problems):
* #7514 introduces a `clear_cache` statement, that's probably not needed
any longer, because a `pre_save` signal clearing the cache was added in
the meantime (the test the ticket refers to can be found
[https://github.com/django/django/blob/attic/newforms-
admin/django/contrib/auth/tests/forms.py here]; removing the statement
doesn't seem to cause any failures now);
* I believe the main issue in #15346 and #15573 was preventing the
creation of more than one site;
* #16353 and #16828 are about a multi-database setup, just an
`allow_migrate` condition is what is needed currently;
* #17415 has a nice test, but moving it to the new testcase makes it even
better (by avoiding the `SitesFrameworkTests.setUp`), the test still fails
with PostgreSQL if you remove the sequence resetting part in
`create_default_site`.

Some cleanup of the patch is needed -- I suspect that removing the
`clear_cache` statement and replacing 1 with SITE_ID should go as separate
tickets.

--
Ticket URL: <https://code.djangoproject.com/ticket/23929#comment:1>

Django

unread,
Nov 28, 2014, 6:45:26 PM11/28/14
to django-...@googlegroups.com
#23929: More tests for create_default_site
-------------------------------+------------------------------------

Reporter: wrwrwr | Owner: nobody
Type: New feature | Status: new
Component: contrib.sites | Version: master
Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted

Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 1
Easy pickings: 0 | UI/UX: 0
-------------------------------+------------------------------------
Changes (by timgraham):

* stage: Unreviewed => Accepted


--
Ticket URL: <https://code.djangoproject.com/ticket/23929#comment:2>

Django

unread,
Dec 1, 2014, 1:47:58 PM12/1/14
to django-...@googlegroups.com
#23929: More tests for create_default_site
-------------------------------------+-------------------------------------

Reporter: wrwrwr | Owner: nobody
Type: New feature | Status: new
Component: contrib.sites | Version: master
Severity: Normal | Resolution:
Keywords: | Triage Stage: Ready for
Has patch: 1 | checkin
Needs tests: 0 | Needs documentation: 0
Easy pickings: 0 | Patch needs improvement: 0
| UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by timgraham):

* needs_better_patch: 1 => 0
* stage: Accepted => Ready for checkin


--
Ticket URL: <https://code.djangoproject.com/ticket/23929#comment:3>

Django

unread,
Dec 1, 2014, 2:39:18 PM12/1/14
to django-...@googlegroups.com
#23929: More tests for create_default_site
-------------------------------------+-------------------------------------
Reporter: wrwrwr | Owner: nobody
Type: New feature | Status: closed
Component: contrib.sites | Version: master
Severity: Normal | Resolution: fixed

Keywords: | Triage Stage: Ready for
Has patch: 1 | checkin
Needs tests: 0 | Needs documentation: 0
Easy pickings: 0 | Patch needs improvement: 0
| UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Tim Graham <timograham@…>):

* status: new => closed
* resolution: => fixed


Comment:

In [changeset:"1f98ec2e53e4636863396ab54f671f4546f9ba4c"]:
{{{
#!CommitTicketReference repository=""
revision="1f98ec2e53e4636863396ab54f671f4546f9ba4c"
Fixed #23929 -- Added more tests for create_default_site.

Refs: #15346, #15573, #16353, #16828.
}}}

--
Ticket URL: <https://code.djangoproject.com/ticket/23929#comment:4>

Django

unread,
Dec 27, 2014, 10:27:20 AM12/27/14
to django-...@googlegroups.com
#23929: More tests for create_default_site
-------------------------------------+-------------------------------------
Reporter: wrwrwr | Owner: nobody
Type: New feature | Status: closed
Component: contrib.sites | Version: master

Severity: Normal | Resolution: fixed
Keywords: | Triage Stage: Ready for
| checkin

Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0

Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------

Comment (by Tim Graham <timograham@…>):

In [changeset:"965a999ae5a03ca595f3842feacfbce5dc12f20a"]:
{{{
#!CommitTicketReference repository=""
revision="965a999ae5a03ca595f3842feacfbce5dc12f20a"
[1.7.x] Fixed #23929 -- Added more tests for create_default_site.

Backport of 1f98ec2e53e4636863396ab54f671f4546f9ba4c from master
}}}

--
Ticket URL: <https://code.djangoproject.com/ticket/23929#comment:5>

Django

unread,
Jun 8, 2026, 1:04:11 PM (22 hours ago) Jun 8
to django-...@googlegroups.com
#23929: More tests for create_default_site
-------------------------------------+-------------------------------------
Reporter: Wojtek Ruszczewski | Owner: nobody
Type: New feature | Status: closed
Component: contrib.sites | Version: dev
Severity: Normal | Resolution: fixed
Keywords: | Triage Stage: Ready for
| checkin
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Comment (by Jacob Walls <jacobtylerwalls@…>):

In [changeset:"7f2afdd0f6a872ccb48d7fbdaacce9b11216af52" 7f2afdd]:
{{{#!CommitTicketReference repository=""
revision="7f2afdd0f6a872ccb48d7fbdaacce9b11216af52"
Refs #23929 -- Fixed test setup in CreateDefaultSiteTests.
}}}
--
Ticket URL: <https://code.djangoproject.com/ticket/23929#comment:6>
Reply all
Reply to author
Forward
0 new messages