permission.tests package

Subpackages

Submodules

permission.tests.compat module

class permission.tests.compat.TestRunner(pattern=None, top_level=None, verbosity=1, interactive=True, failfast=False, keepdb=False, reverse=False, debug_mode=False, debug_sql=False, parallel=0, tags=None, exclude_tags=None, test_name_patterns=None, pdb=False, buffer=False, enable_faulthandler=True, timing=False, shuffle=False, logger=None, **kwargs)[source]

Bases: DiscoverRunner

setup_test_environment(**kwargs)[source]
teardown_test_environment(**kwargs)[source]

permission.tests.models module

class permission.tests.models.Article(id, title, content, author, editor, single_bridge, created_at)[source]

Bases: Model

exception DoesNotExist

Bases: ObjectDoesNotExist

exception MultipleObjectsReturned

Bases: MultipleObjectsReturned

author

Accessor to the related object on the forward side of a many-to-one or one-to-one (via ForwardOneToOneDescriptor subclass) relation.

In the example:

class Child(Model):
    parent = ForeignKey(Parent, related_name='children')

Child.parent is a ForwardManyToOneDescriptor instance.

author_id
authors

Accessor to the related objects manager on the forward and reverse sides of a many-to-many relation.

In the example:

class Pizza(Model):
    toppings = ManyToManyField(Topping, related_name='pizzas')

Pizza.toppings and Topping.pizzas are ManyToManyDescriptor instances.

Most of the implementation is delegated to a dynamically defined manager class built by create_forward_many_to_many_manager() defined below.

content

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

created_at

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

editor

Accessor to the related object on the forward side of a many-to-one or one-to-one (via ForwardOneToOneDescriptor subclass) relation.

In the example:

class Child(Model):
    parent = ForeignKey(Parent, related_name='children')

Child.parent is a ForwardManyToOneDescriptor instance.

editor_id
editors

Accessor to the related objects manager on the forward and reverse sides of a many-to-many relation.

In the example:

class Pizza(Model):
    toppings = ManyToManyField(Topping, related_name='pizzas')

Pizza.toppings and Topping.pizzas are ManyToManyDescriptor instances.

Most of the implementation is delegated to a dynamically defined manager class built by create_forward_many_to_many_manager() defined below.

get_next_by_created_at(*, field=<django.db.models.fields.DateTimeField: created_at>, is_next=True, **kwargs)
get_previous_by_created_at(*, field=<django.db.models.fields.DateTimeField: created_at>, is_next=False, **kwargs)
id

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

multiple_bridge

Accessor to the related objects manager on the forward and reverse sides of a many-to-many relation.

In the example:

class Pizza(Model):
    toppings = ManyToManyField(Topping, related_name='pizzas')

Pizza.toppings and Topping.pizzas are ManyToManyDescriptor instances.

Most of the implementation is delegated to a dynamically defined manager class built by create_forward_many_to_many_manager() defined below.

objects = <django.db.models.manager.Manager object>
single_bridge

Accessor to the related object on the forward side of a many-to-one or one-to-one (via ForwardOneToOneDescriptor subclass) relation.

In the example:

class Child(Model):
    parent = ForeignKey(Parent, related_name='children')

Child.parent is a ForwardManyToOneDescriptor instance.

single_bridge_id
title

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

class permission.tests.models.Bridge(id, author)[source]

Bases: Model

exception DoesNotExist

Bases: ObjectDoesNotExist

exception MultipleObjectsReturned

Bases: MultipleObjectsReturned

author

Accessor to the related object on the forward side of a many-to-one or one-to-one (via ForwardOneToOneDescriptor subclass) relation.

In the example:

class Child(Model):
    parent = ForeignKey(Parent, related_name='children')

Child.parent is a ForwardManyToOneDescriptor instance.

author_id
editors

Accessor to the related objects manager on the forward and reverse sides of a many-to-many relation.

In the example:

class Pizza(Model):
    toppings = ManyToManyField(Topping, related_name='pizzas')

Pizza.toppings and Topping.pizzas are ManyToManyDescriptor instances.

Most of the implementation is delegated to a dynamically defined manager class built by create_forward_many_to_many_manager() defined below.

id

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

objects = <django.db.models.manager.Manager object>
permission_test_multiple_bridge

Accessor to the related objects manager on the forward and reverse sides of a many-to-many relation.

In the example:

class Pizza(Model):
    toppings = ManyToManyField(Topping, related_name='pizzas')

Pizza.toppings and Topping.pizzas are ManyToManyDescriptor instances.

Most of the implementation is delegated to a dynamically defined manager class built by create_forward_many_to_many_manager() defined below.

permission_test_single_bridge

Accessor to the related objects manager on the reverse side of a many-to-one relation.

In the example:

class Child(Model):
    parent = ForeignKey(Parent, related_name='children')

Parent.children is a ReverseManyToOneDescriptor instance.

Most of the implementation is delegated to a dynamically defined manager class built by create_forward_many_to_many_manager() defined below.

permission.tests.test_backends module

class permission.tests.test_backends.PermissionPermissionBackendTestCase(methodName='runTest')[source]

Bases: TestCase

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_authenticate()[source]
test_constructor()[source]
test_has_module_perms()[source]
test_has_perm_with_nil_permission()[source]
test_has_perm_with_nil_permission_raise()[source]
test_has_perm_with_nil_permission_raise_with_user()[source]
test_has_perm_with_nil_permission_with_user()[source]
test_has_perm_with_obj()[source]
test_has_perm_without_obj()[source]

permission.tests.test_handlers module

class permission.tests.test_handlers.PermissionLogicalPermissionHandlerTestCase(methodName='runTest')[source]

Bases: TestCase

setUp()[source]

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

test_constructor_with_app_label()[source]
test_has_perm_permission_logics_called()[source]
class permission.tests.test_handlers.PermissionPermissionHandlersTestCase(methodName='runTest')[source]

Bases: TestCase

setUp()[source]

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

test__get_app_perms_with_app_label()[source]
test__get_app_perms_with_model()[source]
test__get_model_perms()[source]
test_constructor_with_app_label()[source]
test_constructor_with_model()[source]
test_get_supported_app_labels()[source]
test_get_supported_app_labels_with_excludes()[source]
test_get_supported_app_labels_with_excludes_change()[source]
test_get_supported_app_labels_with_includes()[source]
test_get_supported_app_labels_with_includes_change()[source]
test_get_supported_permissions()[source]
test_get_supported_permissions_with_excludes()[source]
test_get_supported_permissions_with_excludes_change()[source]
test_get_supported_permissions_with_includes()[source]
test_get_supported_permissions_with_includes_change()[source]
test_has_module_perms_fail()[source]
test_has_module_perms_success()[source]
test_has_perm_add_wiht_obj()[source]
test_has_perm_add_wihtout_obj()[source]
test_has_perm_change_wiht_obj()[source]
test_has_perm_change_wihtout_obj()[source]
test_has_perm_delete_wiht_obj()[source]
test_has_perm_delete_wihtout_obj()[source]

permission.tests.utils module

permission.tests.utils.create_anonymous(**kwargs)[source]
permission.tests.utils.create_article(title, user=None, bridge=None)[source]
permission.tests.utils.create_bridge(user=None, editors=None)[source]
permission.tests.utils.create_group(name, user=None)[source]
permission.tests.utils.create_permission(name, model=None)[source]
permission.tests.utils.create_user(username, **kwargs)[source]

Module contents