Re: admin.site.register breaks unittests

2008-09-28 Thread Malcolm Tredinnick
On Sun, 2008-09-28 at 21:25 +0200, Gerard Petersen wrote: > Russel, > > Replies inline ... > > > The purpose of admin.autodiscover is to discover all the admin.py > > files in your project. Each admin.py file will then need to contain > > the ModelAdmin definitions and site.register() calls req

Re: admin.site.register breaks unittests

2008-09-28 Thread Gerard Petersen
Russel, Replies inline ... > The purpose of admin.autodiscover is to discover all the admin.py > files in your project. Each admin.py file will then need to contain > the ModelAdmin definitions and site.register() calls required. Ok, so the autodiscover is a recursive functionality that gathers

Re: admin.site.register breaks unittests

2008-09-28 Thread Russell Keith-Magee
On Sun, Sep 28, 2008 at 4:39 PM, Gerard Petersen <[EMAIL PROTECTED]> wrote: > > Russell, > > Is it correct to say that the admin.autodiscover statement should register > the models in 'myapp', and therefore I don't need the individual > admin.site.register statement for each model? No - that is

Re: admin.site.register breaks unittests

2008-09-28 Thread Gerard Petersen
Russell, Is it correct to say that the admin.autodiscover statement should register the models in 'myapp', and therefore I don't need the individual admin.site.register statement for each model? Without the register statements I don't see the group of models (for myapp) and myapp itself in th

Re: admin.site.register breaks unittests

2008-09-27 Thread Russell Keith-Magee
On Sat, Sep 27, 2008 at 9:54 PM, Gerard Petersen <[EMAIL PROTECTED]> wrote: > > Russel, > > The example from the docs somehow doesn't work. I've turned on the > autodiscover but under admin it stays empty. I don't know if this is related, > but putting the register statements in urls.py does sto

Re: admin.site.register breaks unittests

2008-09-27 Thread Gerard Petersen
Russel, The example from the docs somehow doesn't work. I've turned on the autodiscover but under admin it stays empty. I don't know if this is related, but putting the register statements in urls.py does stop breaking my tests. Regards, Gerard. Russell Keith-Magee wrote: > On Sat, Sep 27, 2

Re: admin.site.register breaks unittests

2008-09-27 Thread Russell Keith-Magee
On Sat, Sep 27, 2008 at 3:26 AM, Gerard Petersen <[EMAIL PROTECTED]> wrote: > > Hi all, > > When I run my test suite, commands like these 'admin.site.register(Product, > ProductAdmin)' in models.py break my tests with this error: > > django.contrib.admin.sites.AlreadyRegistered: The model Product

admin.site.register breaks unittests

2008-09-26 Thread Gerard Petersen
Hi all, When I run my test suite, commands like these 'admin.site.register(Product, ProductAdmin)' in models.py break my tests with this error: django.contrib.admin.sites.AlreadyRegistered: The model Product is already registered When I (temporarily) remove them the tests run properly. What