test.SimpleTestCase

class SimpleTestCase [source]

A subclass of unittest.TestCase that adds this functionality:

  • Some useful assertions like:
    • Checking that a callable raises a certain exception.
    • Testing form field rendering and error treatment.
    • Testing HTML responses for the presence/lack of a given fragment.
    • Verifying that a template has/hasn't been used to generate a given response content.
    • Verifying a HTTP redirect is performed by the app.
    • Robustly testing two HTML fragments for equality/inequality or containment.
    • Robustly testing two XML fragments for equality/inequality.
    • Robustly testing two JSON fragments for equality.
  • The ability to run tests with modified settings.
  • Using the client Client.

If your tests make any database queries, use subclasses TransactionTestCase or TestCase.

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

Please login to continue.