Skip to content

Commit 6a919c9

Browse files
committed
Docstrings
1 parent e7ec1aa commit 6a919c9

File tree

2 files changed

+7
-5
lines changed

2 files changed

+7
-5
lines changed

test_app/tests/rbac/remote/test_public_api_compat.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66

77
@pytest.mark.django_db
88
def test_role_definition_list_remote_and_local(admin_api_client, inv_rd, foo_rd):
9+
"Test that the role_definitions endpoint does not choke when remote permissions are listed."
910
url = get_relative_url('roledefinition-list')
1011
response = admin_api_client.get(url)
1112
assert response.status_code == 200
@@ -19,10 +20,8 @@ def test_role_definition_list_remote_and_local(admin_api_client, inv_rd, foo_rd)
1920

2021

2122
@pytest.mark.django_db
22-
def test_create_remote_role_definition(admin_api_client, foo_type, foo_permission):
23-
"""
24-
Test creation of a custom, remote role definition.
25-
"""
23+
def test_create_remote_role_definition_for_remote(admin_api_client, foo_type, foo_permission):
24+
"Test creation of a custom role definition that gives permission to remote things."
2625
url = get_relative_url("roledefinition-list")
2726
data = dict(name='foo-foo-foo-custom', description='bar', permissions=[foo_permission.api_slug], content_type=foo_type.api_slug)
2827
response = admin_api_client.post(url, data=data, format="json")
@@ -32,7 +31,8 @@ def test_create_remote_role_definition(admin_api_client, foo_type, foo_permissio
3231

3332

3433
@pytest.mark.django_db
35-
def test_give_remote_permission(admin_api_client, rando, foo_type, foo_rd):
34+
def test_user_role_assignment_remote_and_local(admin_api_client, rando, foo_type, foo_rd):
35+
"Test that after assigning permission to remote objects the assignment list works."
3636
a_foo = RemoteObject(content_type=foo_type, object_id=42)
3737
assignment = foo_rd.give_permission(rando, a_foo)
3838
assignment.content_object

test_app/tests/rbac/remote/test_remote_assignment.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77

88
@pytest.mark.django_db
99
def test_give_remote_permission(rando, foo_type, foo_permission, foo_rd):
10+
"Test for a few technical elements related to giving permission to remote objects, and using in query."
1011
assert foo_type.service == 'foo' # a place, a domain, a server, known as foo
1112
assert foo_type.api_slug == 'foo.foo' # there lives a foo in foo
1213

@@ -15,6 +16,7 @@ def test_give_remote_permission(rando, foo_type, foo_permission, foo_rd):
1516
a_foo = RemoteObject(content_type=foo_type, object_id=42)
1617
assignment = foo_rd.give_permission(rando, a_foo)
1718
assert '42' in repr(a_foo)
19+
assert a_foo.pk == 42
1820

1921
assignment = RoleUserAssignment.objects.get(pk=assignment.pk)
2022
assert assignment.content_object.pk == 42

0 commit comments

Comments
 (0)