This doesn't seem to be working for me.
I created my own test_settings.py in the project root directory.
I ran
python manage.py test --settings=test_settings
It runs as usual and CSRF still fails when I run tests.
Anyone know what I might be doing wrong here? How can I tell that
python manage.py has accepted my test_settings?
On Jan 26, 10:16 am, davenaff <
daven...@gmail.com> wrote:
> Malcolm,
>
> Thanks a lot for the pointer. For anyone else interested, here is
> what my settings-test.py looks like:
>
> from settings import *
>
> #CSRFMiddleware breaks authtests
> MIDDLEWARE_CLASSES = list(MIDDLEWARE_CLASSES)
> MIDDLEWARE_CLASSES.remove
> ('django.contrib.csrf.middleware.CsrfMiddleware')
>
> # Turn this off to allowteststhat look at http status to pass
> PREPEND_WWW = False
>
> I then run the test suite using this command:
> python manage.py test --settings=
mysite.settings-test.py
>
> Best,
> Dave
>
> On Jan 22, 4:50 pm, Malcolm Tredinnick <
malc...@pointy-stick.com>
> wrote:
>
> > On Thu, 2009-01-22 at 15:17 -0800,davenaffwrote:
> > > What is the best way to disable a specific middleware when running
> > > djangotests?
>
> > > This ticket was designated wontfix, so I get test failures on the auth
> > >testsevery time I run our test suite:
> > > and of course I don't liketeststhat fail...
>
> > Create a settings file for your testing purposes. It imports your
> > standard settings file and then modifies any settings that are specific
> > for thetests(e.g. altering the MIDDLEWARE_CLASSES tuple).
>
> > Regards,
> > Malcolm