Category Archives: Django

Unit Tests in Django

I’m going to talk a bit about some of the practices that I use for unit testing in Django.  If you’re unfamiliar with the Django testing system, you can read up on it here: http://docs.djangoproject.com/en/dev/topics/testing/ In general, I organize my unit tests into folders (ref. Organizing Django Tests into Folders) so I can break them [...]

Also posted in Tech | Tagged , , , , | Leave a comment

Organizing Django Tests into Folders

Update: Due to some strange Django error, Django will refuse to run your app’s tests if your application doesn’t have a models.py file. You’ll need to create an empty models.pyin your app’s folder if you don’t have one Django comes with a nice testing  rig that lets you individually test each app.  By using a [...]

Also posted in python, Tech | Tagged , , , | 6 Comments

Django Unit Test Failure in auth Package

We’ve been using the django.contrib.auth app to handle all of our user login/logout/registration/etc. needs, and it has worked great for us so far.  However, when we tried to run the unit tests for our project we found 10 or so errors with regards to the auth package itself. At first, I thought it was because [...]

Also posted in Tech | Tagged , , , , , | Leave a comment

Creating Django Apps

I’ve been doing a bit of work with the Django framework lately, and because I’m a total noob at it, Derek has been nice enough to hold my hand throughout the dev process. Django relies on the MVC design pattern, so you’ll want to modularize your components by creating Django apps.  From the Django book: [...]

Also posted in python, Tech | Tagged , , , | Leave a comment