[wingide-users] Running unit tests in django

Wingware Support support at wingware.com
Mon Aug 8 10:07:02 MDT 2011

On 8/7/11 8:39 PM, Philip Gatt wrote:
> What's the preferred method for running unit tests in django? I haven't been running unit tests inside wing, but wanted to give it a try and am running into some problems.
> I configured my project using the django "Projects ->  Extensions ->  Configure project for django" tab.  The "default test framework" in my project settings was still at unittest.  On this setting, I get an exception when django tries to introspect the app label for models.MyModel. I suppose I could fix this by manually specifying an app_label on every model, but that's an ugly solution.
> So, I edited project settings and changed tests to "django tests". Now it looks like things run, but I see no results. Also, it seems like every test is running even if I only tell it to run one file.

It looks like the Django project setup is setting the test framework 
type on the file manage.py specifically (in the file properties for that 
file) and not project-wide.  You should see manage.py in the Testing 
tool without altering the project properties and right clicking to run 
tests should run all the tests run by 'manage.py test'.  Then you can 
click specific ones to run just those (but the initial discovery of 
tests requires running the whole test suite).

If you're not trying to run 'manage.py tests' you probably want a 
different configuration, although from what you write I'm not sure of 
the details.

Please let me know if this does not help.



Stephan Deibel
Wingware | Python IDE
Advancing Software Development


More information about the wingide-users mailing list