Django: Best way to unit-test an abstract model

Just stumbled across this feature myself: You can just inherit from your abstract model in tests.py and test that as usual. When you run ‘manage.py tests’, Django not only creates a test database, but also validates & syncs your test models.

Tested it with current Django trunk (version 1.2).

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)