python - Test specific models in Django -


is possible have set of models testing purposes? idea i've written app contains helper abstract model helperbase. i'd provide models inherit in order test it, derivedtest1, derivedtest2. wouldn't test models appear in production database in end. want tables constructed in test database. possible , if - how it? i've tried creating models in tests.py file doesn't seem work.

you try creating whole new app use on development server.

e.g., if app called myapp call testing app myapp_test.

then in myapp_test's models.py from myapp import models , subclass models in there.

then in settings.py either try , remember comment out myapp_test application installed_apps when deploying production server. or can use local_settings.py methodology have myapp_test included in installed_apps on test machine.


Comments

Popular posts from this blog

php - What is the difference between $_SERVER['PATH_INFO'] and $_SERVER['ORIG_PATH_INFO']? -

fortran - Function return type mismatch -

queue - mq_receive: message too long -