tests.site_decorators_tests module#

Tests against a fake Site object.

class tests.site_decorators_tests.TestMustBe(*args, **kwargs)[source]#

Bases: DisableSiteMixin, DebugOnlyTestCase

Test cases for the must_be decorator.

abstract_class = False#
call_this_steward_req_function(*args, **kwargs)[source]#

Require a sysop to function.

call_this_sysop_req_function(*args, **kwargs)[source]#

Require a sysop to function.

call_this_user_req_function(*args, **kwargs)[source]#

Require a user to function.

has_group(group)[source]#

Fake the groups user belongs to.

login(group)[source]#

Fake the log in as required user group.

setUp()[source]#

Creating fake variables to appear as a site.

test_mock_in_test()[source]#

Test that setUp and login work.

test_mock_in_test_reset()#

Test that setUp and login work.

test_must_be_steward()[source]#

Test a function which requires a sysop.

test_must_be_sysop()[source]#

Test a function which requires a sysop.

test_must_be_user()[source]#

Test a function which requires a user.

test_obsolete_site()[source]#

Test when the site is obsolete and shouldn’t be edited.

test_override_usertype()[source]#

Test overriding the required group.

user()[source]#

Fake the logged in user.

class tests.site_decorators_tests.TestNeedRight(*args, **kwargs)[source]#

Bases: DisableSiteMixin, DebugOnlyTestCase

Test cases for the must_be decorator.

abstract_class = False#
call_this_edit_req_function(*args, **kwargs)[source]#

Require a sysop to function.

call_this_move_req_function(*args, **kwargs)[source]#

Require a sysop to function.

has_right(right)[source]#

Fake the groups user belongs to.

login(group, right)[source]#

Fake the log in as required user group.

setUp()[source]#

Creating fake variables to appear as a site.

test_need_right_edit()[source]#

Test a function which requires a sysop.

test_need_right_move()[source]#

Test a function which requires a sysop.

user()[source]#

Fake the logged in user.

class tests.site_decorators_tests.TestNeedVersion(*args, **kwargs)[source]#

Bases: DisableSiteMixin, DeprecationTestCase

Test cases for the need_version decorator.

abstract_class = False#
deprecated_available_method()[source]#

Method which is old enough and then deprecated.

deprecated_available_method2()[source]#

Deprecated.

Method which is deprecated first and then old enough.

deprecated_unavailable_method()[source]#

Method which is to new and then deprecated.

deprecated_unavailable_method2()[source]#

Deprecated.

Method which is deprecated first and then to new.

old_enough()[source]#

Method which is as new as the server.

older()[source]#

Method which is old enough.

setUp()[source]#

Set up test method.

test_need_version()[source]#

Test need_version when the version is new, exact or old enough.

test_need_version_fail_with_deprecated()[source]#

Test order of combined version check and deprecation warning.

test_need_version_success_with_deprecated()[source]#

Test order of combined version check and deprecation warning.

too_new()[source]#

Method which is to new.