Module Import alias ImportFrom alias ImportFrom alias ImportFrom alias ImportFrom alias ImportFrom alias ImportFrom alias alias alias ImportFrom alias ImportFrom alias ImportFrom alias Assign NameStore Call AttributeLoad NameLoad attr NameLoad FunctionDef arguments args defaults body Assign NameStore Call NameLoad Assign SubscriptStore AttributeLoad NameLoad attr Index Str Str Assign SubscriptStore AttributeLoad NameLoad attr Index Str Num Return Call NameLoad NameLoad decorator_list FunctionDef arguments args NameParam NameParam NameParam defaults NameLoad body If NameLoad body Return CompareIn NameLoad Call NameLoad NameLoad NameLoad orelse For NameStore Call AttributeLoad AttributeLoad NameLoad attr attr body If CompareEq AttributeLoad NameLoad attr NameLoad body Return NameLoad Return NameLoad decorator_list ClassDef bases NameLoad body Assign NameStore Dict FunctionDef arguments args NameParam defaults body If UnaryOpNot AttributeLoad NameLoad attr body Return NameLoad If UnaryOpNot Call NameLoad AttributeLoad NameLoad attr NameLoad body Raise Call NameLoad Str If CompareNotIn Str AttributeLoad NameLoad attr body Raise Call NameLoad Str If CompareNotIn Str AttributeLoad NameLoad attr body Raise Call NameLoad Str Return NameLoad decorator_list NameLoad FunctionDef arguments args NameParam defaults body Assign AttributeStore NameLoad attr Call SubscriptLoad AttributeLoad NameLoad attr Index Str Call AttributeLoad AttributeLoad NameLoad attr attr Str Dict Expr Call AttributeLoad AttributeLoad NameLoad attr attr decorator_list FunctionDef arguments args NameParam defaults body Expr Str If UnaryOpNot Call AttributeLoad NameLoad attr body Return Expr Call AttributeLoad AttributeLoad NameLoad attr attr keyword Str keyword Str Assign NameStore Call AttributeLoad SubscriptLoad AttributeLoad NameLoad attr Index Str attr AttributeLoad AttributeLoad NameLoad attr attr For NameStore SubscriptLoad AttributeLoad NameLoad attr Index Str body Assign NameStore SubscriptLoad NameLoad Index Str Assign NameStore Call Call NameLoad AttributeLoad NameLoad attr NameLoad NameLoad Call AttributeLoad NameLoad attr Str Dict Expr Call AttributeLoad NameLoad attr AttributeLoad NameLoad attr AttributeLoad NameLoad attr Expr Call NameLoad BinOpMod SubscriptLoad AttributeLoad NameLoad attr Index Str SubscriptLoad NameLoad Index Str AttributeLoad NameLoad attr AttributeLoad NameLoad attr Assign NameStore Call Call NameLoad AttributeLoad NameLoad attr NameLoad NameLoad Call AttributeLoad NameLoad attr Str Dict Assign NameStore Call AttributeLoad NameLoad attr Str AttributeLoad NameLoad attr Expr Call AttributeLoad NameLoad attr AttributeLoad NameLoad attr NameLoad Expr Call NameLoad BinOpMod SubscriptLoad AttributeLoad NameLoad attr Index Str SubscriptLoad NameLoad Index Str AttributeLoad NameLoad attr AttributeLoad NameLoad attr decorator_list FunctionDef arguments args NameParam defaults body Assign NameStore Call AttributeLoad SubscriptLoad AttributeLoad NameLoad attr Index Str attr AttributeLoad AttributeLoad NameLoad attr attr AugAssignAdd NameStore Str Expr Call AttributeLoad AttributeLoad NameLoad attr attr keyword Str keyword Str Assign NameStore Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad Dict Str Str Str Str Expr Call AttributeLoad NameLoad attr AttributeLoad NameLoad attr AttributeLoad NameLoad attr Assign NameStore Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad Dict Str Str Str ListLoad Str Expr Call AttributeLoad NameLoad attr AttributeLoad NameLoad attr AttributeLoad NameLoad attr Expr Call AttributeLoad NameLoad attr Call AttributeLoad AttributeLoad NameLoad attr attr BinOpMod SubscriptLoad AttributeLoad NameLoad attr Index Str Str AttributeLoad NameLoad attr Expr Call AttributeLoad AttributeLoad NameLoad attr attr keyword Str keyword Str decorator_list FunctionDef arguments args NameParam defaults body Assign NameStore Call AttributeLoad SubscriptLoad AttributeLoad NameLoad attr Index Str attr AttributeLoad AttributeLoad NameLoad attr attr AugAssignAdd NameStore Str Expr Call AttributeLoad AttributeLoad NameLoad attr attr keyword Str keyword Str Assign NameStore Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad Expr Call AttributeLoad NameLoad attr AttributeLoad NameLoad attr AttributeLoad NameLoad attr Expr Call AttributeLoad NameLoad attr Assign NameStore Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad Expr Call AttributeLoad NameLoad attr AttributeLoad NameLoad attr AttributeLoad NameLoad attr decorator_list FunctionDef arguments args NameParam defaults body Assign NameStore Call AttributeLoad SubscriptLoad AttributeLoad NameLoad attr Index Str attr AttributeLoad AttributeLoad NameLoad attr attr Assign NameStore BinOpAdd NameLoad Str Expr Call AttributeLoad AttributeLoad NameLoad attr attr keyword Str keyword Str Assign NameStore Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad Dict Str Str Str Str Expr Call AttributeLoad NameLoad attr AttributeLoad NameLoad attr AttributeLoad NameLoad attr Expr Call AttributeLoad NameLoad attr Assign NameStore Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad Dict Str Str Str ListLoad Str Expr Call AttributeLoad NameLoad attr AttributeLoad NameLoad attr AttributeLoad NameLoad attr Assign NameStore Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad Dict Str Str Str ListLoad Str Expr Call AttributeLoad NameLoad attr AttributeLoad NameLoad attr AttributeLoad NameLoad attr Expr Call AttributeLoad NameLoad attr Call AttributeLoad AttributeLoad NameLoad attr attr BinOpMod SubscriptLoad AttributeLoad NameLoad attr Index Str Str AttributeLoad NameLoad attr Assign NameStore Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad Expr Call AttributeLoad NameLoad attr AttributeLoad NameLoad attr AttributeLoad NameLoad attr Assign NameStore Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad Expr Call AttributeLoad NameLoad attr AttributeLoad NameLoad attr AttributeLoad NameLoad attr Expr Call AttributeLoad NameLoad attr SubscriptLoad AttributeLoad NameLoad attr Index Str ListLoad Str Str decorator_list decorator_list ClassDef bases NameLoad body Expr Str FunctionDef arguments args NameParam defaults body Assign AttributeStore NameLoad attr Call NameLoad Assign AttributeStore NameLoad attr Call AttributeLoad AttributeLoad Call NameLoad attr attr keyword Str Assign AttributeStore NameLoad attr Call AttributeLoad AttributeLoad Call NameLoad attr attr keyword Str Assign AttributeStore NameLoad attr Call AttributeLoad AttributeLoad NameLoad attr attr keyword Str Expr Call AttributeLoad AttributeLoad AttributeLoad NameLoad attr attr attr AttributeLoad NameLoad attr If Call NameLoad NameLoad Str body Expr Call AttributeLoad NameLoad attr decorator_list FunctionDef arguments args NameParam defaults body Assign NameStore Call NameLoad Expr Call AttributeLoad AttributeLoad NameLoad attr attr Str Str Str keyword Str keyword Str Expr Call AttributeLoad AttributeLoad NameLoad attr attr Str Str Str keyword Str keyword Str Expr Call AttributeLoad AttributeLoad NameLoad attr attr keyword Str decorator_list NameLoad FunctionDef arguments args NameParam NameParam NameParam defaults NameLoad body Expr Str If UnaryOpNot Call NameLoad NameLoad body Assign NameStore BinOpMod Str Call NameLoad NameLoad Expr Call AttributeLoad NameLoad attr Call AttributeLoad NameLoad attr NameLoad NameLoad decorator_list decorator_list
N/A N/A logging unittest.util safe_repr django.contrib.auth get_user_model django.contrib.auth.models Group django.http HttpRequest django.test TestCase guardian.shortcuts assign_perm remove_perm get_perms rest_framework status rest_framework.request Request rest_framework.test APIClient N/A logger N/A N/A logging getLogger __name__ get_fake_request N/A N/A N/A N/A N/A django_request N/A HttpRequest N/A N/A N/A django_request META N/A SERVER_NAME localhost.localdomain N/A N/A N/A django_request META N/A SERVER_PORT 80 N/A N/A Request django_request N/A group_has_perm N/A N/A group perm obj N/A None N/A N/A obj N/A N/A N/A perm N/A get_perms group obj N/A N/A gperm N/A N/A N/A group permissions all N/A N/A N/A N/A gperm codename perm N/A N/A True N/A False N/A PermissionsMixin N/A object N/A N/A permission_tests N/A _error_check_permissions N/A N/A cls N/A N/A N/A N/A N/A cls permission_tests N/A N/A False N/A N/A N/A isinstance N/A cls permission_tests dict N/A N/A N/A AssertionError The `permission_tests` attribute must be a dict N/A N/A model N/A cls permission_tests N/A N/A N/A AssertionError You must specify a model to create an instance of N/A N/A endpoint N/A cls permission_tests N/A N/A N/A AssertionError You must specify an endpoint N/A True N/A classmethod set_up_perms N/A N/A self N/A N/A N/A N/A self obj N/A N/A N/A self permission_tests N/A model N/A N/A N/A self permission_tests get create_data N/A N/A N/A N/A N/A self obj save N/A test_permissions N/A N/A self N/A N/A N/A 
        Generic method to test permissions for each resource
         N/A N/A N/A N/A self _error_check_permissions N/A N/A N/A N/A N/A N/A self client login username test.user password 1234 N/A endpoint N/A N/A N/A N/A self permission_tests N/A endpoint format N/A N/A self obj pk N/A perm_type N/A N/A self permission_tests N/A permission_types N/A N/A method N/A perm_type N/A method N/A response N/A N/A getattr N/A self client method endpoint N/A N/A perm_type get data N/A N/A N/A N/A self assertEqual N/A response status_code N/A status HTTP_404_NOT_FOUND N/A N/A assign_perm N/A N/A N/A self permission_tests N/A permission N/A perm_type N/A perm N/A self user N/A self obj N/A response N/A N/A getattr N/A self client method endpoint N/A N/A perm_type get data N/A N/A expected_code N/A N/A perm_type get code N/A status HTTP_200_OK N/A N/A N/A self assertEqual N/A response status_code expected_code N/A N/A remove_perm N/A N/A N/A self permission_tests N/A permission N/A perm_type N/A perm N/A self user N/A self obj N/A _add_admin_object_permission N/A N/A self N/A N/A N/A endpoint N/A N/A N/A N/A self permission_tests N/A endpoint format N/A N/A self obj pk N/A endpoint permissions/users/ N/A N/A N/A N/A self client login username test.admin password 1234 N/A response N/A N/A N/A self client post endpoint N/A user permissions test.user admin N/A N/A N/A self assertEqual N/A response status_code N/A status HTTP_400_BAD_REQUEST N/A response N/A N/A N/A self client post endpoint N/A user permissions test.user N/A admin N/A N/A N/A self assertEqual N/A response status_code N/A status HTTP_201_CREATED N/A N/A N/A self assertTrue N/A N/A N/A self user has_perm N/A N/A N/A self permission_tests N/A permission admin N/A self obj N/A N/A N/A N/A self client login username test.user password 1234 N/A test_add_object_permissions N/A N/A self N/A N/A N/A endpoint N/A N/A N/A N/A self permission_tests N/A endpoint format N/A N/A self obj pk N/A endpoint permissions/users/ N/A N/A N/A N/A self client login username test.user password 1234 N/A response N/A N/A N/A self client get endpoint N/A N/A N/A self assertEqual N/A response status_code N/A status HTTP_404_NOT_FOUND N/A N/A N/A self _add_admin_object_permission N/A response N/A N/A N/A self client get endpoint N/A N/A N/A self assertEqual N/A response status_code N/A status HTTP_200_OK N/A test_partial_update_object_permissions N/A N/A self N/A N/A N/A orig_endpoint N/A N/A N/A N/A self permission_tests N/A endpoint format N/A N/A self obj pk N/A endpoint N/A orig_endpoint permissions/users/test.user/ N/A N/A N/A N/A self client login username test.user password 1234 N/A response N/A N/A N/A self client put endpoint N/A user permissions test.user blah N/A N/A N/A self assertEqual N/A response status_code N/A status HTTP_404_NOT_FOUND N/A N/A N/A self _add_admin_object_permission N/A response N/A N/A N/A self client put endpoint N/A user permissions test.user N/A blah N/A N/A N/A self assertEqual N/A response status_code N/A status HTTP_400_BAD_REQUEST N/A response N/A N/A N/A self client patch endpoint N/A user permissions test.user N/A view N/A N/A N/A self assertEqual N/A response status_code N/A status HTTP_200_OK N/A N/A N/A self assertTrue N/A N/A N/A self user has_perm N/A N/A N/A self permission_tests N/A permission view N/A self obj N/A response N/A N/A N/A self client get orig_endpoint N/A N/A N/A self assertEqual N/A response status_code N/A status HTTP_200_OK N/A response N/A N/A N/A self client get endpoint N/A N/A N/A self assertEqual N/A response status_code N/A status HTTP_200_OK N/A N/A N/A self assertEqual N/A N/A response data N/A permissions N/A admin view N/A N/A StackdioTestCase N/A TestCase N/A N/A 
    Base test case class for stackd.io.  We'll add a client object, and create an admin and a
    regular user.  We'll also create an 'everybody' group with permissions to view most of the
    endpoints.
     setUp N/A N/A self N/A N/A N/A N/A self client N/A APIClient N/A N/A self user N/A N/A N/A N/A get_user_model objects get username test.user N/A N/A self admin N/A N/A N/A N/A get_user_model objects get username test.admin N/A N/A self group N/A N/A N/A Group objects get name stackdio N/A N/A N/A N/A N/A self user groups add N/A self group N/A N/A hasattr self set_up_perms N/A N/A N/A N/A self set_up_perms N/A setUpTestData N/A N/A cls N/A N/A N/A user_model N/A get_user_model N/A N/A N/A N/A user_model objects create_superuser test.admin test.admin@stackd.io 1234 first_name Test last_name Admin N/A N/A N/A N/A user_model objects create_user test.user test.user@stackd.io 1234 first_name Test last_name User N/A N/A N/A N/A Group objects create name stackdio N/A classmethod assertCallable N/A N/A self obj msg N/A None N/A N/A Same as self.assertTrue(callable(obj)), with a nicer
        default message. N/A N/A N/A callable obj N/A N/A standardMsg N/A %s is not callable N/A safe_repr obj N/A N/A N/A self fail N/A N/A self _formatMessage msg standardMsg N/A N/A