Question: standalone django application

21 views
Skip to first unread message

Abhijit Chatterjee

unread,
May 12, 2015, 11:55:40 AM5/12/15
to django...@googlegroups.com
Idk if this is the right forum to post this question but I have been fiddling around with:


Is django-standalone is only to test ORM? Or we can also test our controller function as well?


Tom Evans

unread,
May 12, 2015, 12:51:05 PM5/12/15
to django...@googlegroups.com
django-standalone seems to be for running django without a project.
You should test your "controller function", whatever that is, by
writing unit tests that exercise its functionality, ideally mocking
calls to the ORM - assume the ORM works.

The ORM has hundreds of tests, they are contained within Django
itself. The ORM is well tested, you should not need to test it
yourself. IE, tests that save an object to the database and then test
that the database saved it are not useful.

You can run the django testsuite yourself, see here for details:

https://docs.djangoproject.com/en/1.8/internals/contributing/writing-code/unit-tests/

It is usually only necessary if you are modifying django internals.

Cheers

Tom
Reply all
Reply to author
Forward
0 new messages