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 is already > registered > > When I (temporarily) remove them the tests run properly. > > What am I misssing?
Although you _can_ put admin registrations in models.py (and this was historically the suggested approach at one point in the past), it is generally recommended that you put them in an admin.py module, and use admin.autodiscover() in your urls.py to find and register the admin models. This avoids the multiple registration problem. More details here: http://docs.djangoproject.com/en/dev/ref/contrib/admin/ Yours, Russ Magee %-) --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/django-users?hl=en -~----------~----~----~----~------~----~------~--~---