Available tests

Forms

class thecut.authorship.tests.test_forms.TestAuthorshipMixin(methodName='runTest')[source]
test_requires_an_extra_argument_on_creating_an_instance()[source]

Ensure that thecut.authorship.forms.AuthorshipMixin-based forms cannot be instantiated without passing in a user.

test_sets_user_attribute()[source]

Ensure that thecut.authorship.forms.AuthorshipMixin-based forms properly set thecut.authorship.forms.AuthorshipMixin.user when one is passed on instantiation.

class thecut.authorship.tests.test_forms.TestAuthorshipMixinSave(methodName='runTest')[source]
test_calls_super_class_save_method(*args, **keywargs)[source]

Ensure that thecut.authorship.forms.AuthorshipMixin.save() calls the superclass’s save method..

test_does_not_set_created_by_if_instance_is_saved(*args, **keywargs)[source]

Ensure that thecut.authorship.forms.AuthorshipMixin-based forms do not set thecut.authorship.models.AuthorshipMixin.created_by if the target object has already been saved.

test_sets_created_by_if_instance_is_not_saved(*args, **keywargs)[source]

Ensure that thecut.authorship.forms.AuthorshipMixin-based forms appropriately set thecut.authorship.models.AuthorshipMixin.created_by when a user is provided and the target object has not been saved before.

test_sets_updated_by_to_given_user(*args, **keywargs)[source]

Ensure that thecut.authorship.forms.AuthorshipMixin-based forms appropriately set thecut.authorship.models.AuthorshipMixin.updated_by when a user is provided.

Models

class thecut.authorship.tests.test_models.TestAuthorshipModel(methodName='runTest')[source]
test_does_not_change_created_by_when_model_instance_is_saved()[source]

Ensure that thecut.authorship.models.Authorship.created_by is not updated for existing models.

test_sets_created_by_when_model_instance_is_first_saved()[source]

Check if created_by is correctly set on first save.

test_sets_updated_at_if_update_fields_is_specified()[source]

Ensure that thecut.authorship.models.Authorship.updated_at is updated, even when update_fields is specified.

test_sets_updated_by_if_update_fields_is_specified()[source]

Ensure that thecut.authorship.models.Authorship.updated_by is updated, even when update_fields is specified.

test_sets_updated_by_when_model_instance_is_saved()[source]

Ensure that thecut.authorship.models.Authorship.updated_by is updated on save.

Utils

class thecut.authorship.tests.test_utils.TestGetWebsiteUser(methodName='runTest')[source]

Tests for get_website_user().

test_get_website_user_returns_same_user()[source]

Test if the same user is returned over multiple calls.

test_get_website_user_returns_user()[source]

Test if something is returned.