maillib.tests package

Submodules

maillib.tests.test_urls module

class maillib.tests.test_urls.TestUrls(methodName='runTest')[source]

Bases: TestCase

Test cases for the maillib urls in the maillib Django app’s urls.py.

Methods: - test_home_url_resolved: Tests that the call to the home url name resolves successfully

test_home_url_resolved()[source]

Tests that the call to the home url name resolves successfully

maillib.tests.test_views module

class maillib.tests.test_views.TestViews(methodName='runTest')[source]

Bases: TestCase

Test cases for the maillib view in the maillib Django app.

Methods: - setUp: Initializes the client object to simulate a web browser and the reverse function

stored in home_url, used to get the home view.

  • test_should_show_home_page: Tests that the home view successfully loads the home.html template.

  • test_email_validate: tests that the validate url call returns a 200 status code and that the

    template used is home.html

  • test_valid_email: Tests that the API call to the validate email endpoint returns success=True if the email

    provided is valid

  • test_send_email: Tests that the API call to the send email endpoint sends an email successfully and returns

    success=True

setUp()[source]

Initializes the client object to simulate a web browser and the reverse function stored in home_url, used to get the home view.

test_email_validate()[source]

tests that the validate url call returns a 200 status code and that the template used is home.html

test_send_email()[source]

Tests that the API call to the send email endpoint sends an email successfully and returns success=True

test_should_show_home_page()[source]

Tests that the home view successfully loads the home.html template.

test_valid_email()[source]

Tests that the API call to the validate email endpoint returns success=True if the email provided is valid

Module contents