On Tue, Aug 25, 2009 at 2:12 PM, Joseph (Driftwood Cove
Designs)<powderfl...@gmail.com> wrote:
>
> We use a custom authentication backend, and I'm trying to develop a
> test suite for it.  The app has no model, since it uses the model from
> contrib.auth  So, I put my tests in tests.py, but the test runner does
> not load it, even though the custom auth app is in INSTALLED_APPS.  I
> tried adding an empty models.py file to the folder, but that seemed to
> cause some major issues during syncdb (trying to create duplicate
> tables)
>
> When I move test.py to another app (with a models.py), it runs fine,
> but doesn't run at all when I move it back into the custom auth app
> (with no model).
>
> From the Django documentation:
> For a given Django application, the test runner looks for doctests in
> two places:
>    * The models.py file. ...
>    * A file called tests.py in the application directory -- i.e., the
> directory that holds models.py. ...
> ...
> $ ./manage.py test
> By default, this will run every test in every application in
> INSTALLED_APPS.
>
> The first bit of documentation seems to indicate that the test runner
> will only look in directories that contain a models.py (why?).  The
> second bit seems more sensible, but does not appear to be true.
>
> Any advice on how to get the test runner to run my tests or where to
> put the tests (sensibly) so they run?
> >
>

You can put your tests in a tests.py file, however you still need to
have an empty models.py file, so Django picks up the app correctly.

Alex

-- 
"I disapprove of what you say, but I will defend to the death your
right to say it." -- Voltaire
"The people's good is the highest law." -- Cicero
"Code can always be simpler than you think, but never as simple as you
want" -- Me

--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---

Reply via email to