Django DRY Tests

Package with new powerful TestCases and Assets to test django application fast. TDD is supported

Project on GitHub

Mission

The mission of the Django DRY Tests to design and develop open source python package to test django application

  • fast

  • with minimal code duplication

  • with the ability to use TDD easily

  • simple and comfortable

Open Source Project

This is the open source project with MIT license. Be free to use, fork, clone and contribute.

Features

  • Special Request, Response and Form classes to simple set test data

  • Special SimpleTestCase and TestCase classes with new asserts:

    • The main asserts is assertTrueResponse and assertTrueForm. You can use this for most cases.

    • Other special asserts:

class dry_tests.testcases.TestCaseMixin[source]

Main TestCase without test database

assertContentValues(current_response, true_response)[source]

Check Content Value :param request: Request :param response: Response :return: None

assertContextItems(current_response, true_response)[source]

Check Context Value :param current_response: HttpResponse :param true_response: TrueResponse :return: None

assertContextTypes(current_response, true_response)[source]

Check context values types :param current_response: HttpResponse :param true_response: TrueResponse :return:

assertFieldsInForm(current_form, true_form)[source]

Check fields in form :param current_form: :param true_form: :return:

assertFormFieldsCount(current_form, true_form)[source]

Check fields count :param current_form: :param true_form: :return:

assertFormTypes(current_form, true_form)[source]

Check form fields types :param current_form: :param true_form: :return:

assertKeysInContext(current_response, true_response)[source]

Check Value In Context :param request: Request :param response: Response :return: None

assertRedirectUrl(current_response, true_response)[source]

Check Redirect Url :param request: Request :param response: Response :return: None

assertResponsesAreTrue(response_pairs)[source]

Check all response pairs :param response_pairs: :return:

assertStatusCode(current_response, true_response)[source]

Check status code :param request: Request :param response: Response :return: None

assertTrueForm(current_form, true_form)[source]

Main assert for Forms :param current_form: django form :param true_form: TrueForm :return: None

assertTrueResponse(current_response, true_response)[source]

Main assert for request and response Check all parameters sent in response :param request: Request :param response: Response :return: None

assertValuesInContext(current_response, true_response)[source]

Check Value In Context :param request: Request :param response: Response :return: None

Requirements

Django==4.2.6

Development Status

  • django-dry-tests

  • 1.0.0

  • 4 - Beta

Project on PyPi