[Django]-How do I efficiently test this Django model?

5👍

That’s quite enough. Just a couple of notes:

  1. No need to delete properties in tearDown
  2. You forgot to tests UserManager in lines raise ValueError using assertRaises.
  3. You may also test that user created by create_user(from UserManager) can authenticate(from django.contrib.auth) by given password and email.
  4. Use coverage package to detect which lines/classes/packages/statements were missed to test.

Leave a comment