test.TestCase

class TestCase [source]

This is the most common class to use for writing tests in Django. It inherits from TransactionTestCase (and by extension SimpleTestCase). If your Django application doesn’t use a database, use SimpleTestCase.

The class:

  • Wraps the tests within two nested atomic() blocks: one for the whole class and one for each test. Therefore, if you want to test some specific database transaction behavior, use TransactionTestCase.
  • Checks deferrable database constraints at the end of each test.
Changed in Django 1.10:

The check for deferrable database constraints at the end of each test was added.

It also provides an additional method:

doc_Django
2016-10-09 18:40:08
Comments
Leave a Comment

Please login to continue.