tests.accounts package

Submodules

tests.accounts.factories module

class tests.accounts.factories.CustomUserFactory(**kwargs)[source]

Bases: DjangoModelFactory

Create a Custom User (Account)

email = <factory.faker.Faker object>
first_name = <factory.faker.Faker object>
last_name = <factory.faker.Faker object>
password = <factory.faker.Faker object>
username = <factory.faker.Faker object>

tests.accounts.test_database module

tests.accounts.test_database.test_user_soft_delete()[source]

Ensure soft deletes and undeletes update the database properly

  • emails are ensured to be unique,

  • CustomUser prints out as expected,

  • deleted_only (custom function) return the deleted custom users

  • run as large test to minimize database setup and teardown

tests.accounts.test_database_cases module

class tests.accounts.test_database_cases.UserModelsTestCase(methodName='runTest')[source]

Bases: TestCase

using testcase with factoryboy for testing updates to the database.

  • run as large test to minimize database setup and teardown

setUp()[source]

Hook method for setting up the test fixture before exercising it.

tearDown()[source]

Hook method for deconstructing the test fixture after testing it.

test_user_soft_delete()[source]

Endure soft deletes and undeletes update the database properly

Module contents