On Fri, Jun 5, 2009 at 5:28 PM, foxbunny<bg.bra...@gmail.com> wrote: > > Hi, > > I'm trying to figure out how to create tests for my PermaLib app. It > uses ContentTypes to store permalinks for any model in a Django > project. Since the app itself has only one model, and it has no > get_absolute_url() (obviously, because it is not needed), I was trying > to find a way to define a model within the `tests.py`, to test storage > of premalinks, etc. > > Is that possible, and how is it done? If it's not possible, how do I > test this?
There isn't anything built into Django to do this at the present, but it can be done. This very topic is the subject of ticket #7835. This ticket aims to allow you to define models for testing purposes. The ticket has a patch which is fairly good, and is probably pretty close to a strategy that will eventually find its way into trunk. The ticket also has some useful tips in the comments, which indicates how you can mock up analogous behaviour without requiring modifications to Django itself. 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 django-users+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/django-users?hl=en -~----------~----~----~----~------~----~------~--~---