scram.users.tests package

Submodules

scram.users.tests.factories module

class scram.users.tests.factories.UserFactory(**kwargs)

Bases: DjangoModelFactory

email = <factory.faker.Faker object>
name = <factory.faker.Faker object>
password = <factory.declarations.PostGeneration object>
username = <factory.faker.Faker object>

scram.users.tests.test_admin module

class scram.users.tests.test_admin.TestUserAdmin

Bases: object

test_add(admin_client)
test_changelist(admin_client)
test_view_user(admin_client)

scram.users.tests.test_drf_urls module

scram.users.tests.test_drf_urls.test_user_detail(user: User)
scram.users.tests.test_drf_urls.test_user_list()
scram.users.tests.test_drf_urls.test_user_me()

scram.users.tests.test_drf_views module

class scram.users.tests.test_drf_views.TestUserViewSet

Bases: object

test_get_queryset(user: User, rf: RequestFactory)
test_me(user: User, rf: RequestFactory)

scram.users.tests.test_forms module

Module for all Form Tests.

class scram.users.tests.test_forms.TestUserCreationForm

Bases: object

Test class for all tests related to the UserCreationForm

test_username_validation_error_msg(user: User)
Tests UserCreation Form’s unique validator functions correctly by testing:
  1. A new user with an existing username cannot be added.

  2. Only 1 error is raised by the UserCreation Form

  3. The desired error message is raised

scram.users.tests.test_models module

scram.users.tests.test_models.test_user_get_absolute_url(user: User)

scram.users.tests.test_urls module

scram.users.tests.test_urls.test_detail(user: User)
scram.users.tests.test_urls.test_redirect()
scram.users.tests.test_urls.test_update()

scram.users.tests.test_views module

class scram.users.tests.test_views.TestUserDetailView

Bases: object

test_authenticated(user: User, rf: RequestFactory)
test_not_authenticated(user: User, rf: RequestFactory)
class scram.users.tests.test_views.TestUserRedirectView

Bases: object

test_get_redirect_url(user: User, rf: RequestFactory)
class scram.users.tests.test_views.TestUserUpdateView

Bases: object

test_form_valid(user: User, rf: RequestFactory)
test_get_object(user: User, rf: RequestFactory)
test_get_success_url(user: User, rf: RequestFactory)

Module contents