Skip to content

Commit 00afb53

Browse files
renzonrenzon
authored andcommitted
Allows Bootcamper Access to Advanced Modules
close #3329
1 parent 52862db commit 00afb53

3 files changed

Lines changed: 13 additions & 12 deletions

File tree

‎conftest.py‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ def client_with_user(client, logged_user):
1919

2020

2121
_all_roles = set('data_scientist lead client webdev bootcamper pythonista member'.split())
22-
_advanced_roles = set('member pythonista'.split())
22+
_advanced_roles = set('member pythonista bootcamper'.split())
2323
_level_zero_roles = set('lead client webdev bootcamper member'.split())
2424
_level_one_roles = set('client webdev bootcamper member'.split())
2525
_level_two_roles = set('webdev bootcamper member'.split())

‎pythonpro/modules/permissions.py‎

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,15 @@
1212
_LEAD_MODULES = {'python-birds'}
1313
_CLIENT_MODULES = {'python-birds', 'pytools'}
1414
_WEBDEV_MODULES = {'python-birds', 'pytools', 'django', 'entrevistas-tecnicas'}
15-
_BOOTCAMPER_MODULES = {'python-birds', 'pytools', 'django', 'entrevistas-tecnicas'}
15+
_BOOTCAMPER_MODULES = {
16+
'python-birds',
17+
'pytools',
18+
'django',
19+
'entrevistas-tecnicas',
20+
'objetos-pythonicos',
21+
'python-para-pythonistas',
22+
'python-patterns'
23+
}
1624
_PYTHONISTA_MODULES = {'python-birds', 'objetos-pythonicos', 'python-para-pythonistas', 'python-patterns'}
1725

1826

‎pythonpro/modules/tests/test_module_index_view_roles_access.py‎

Lines changed: 3 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -115,20 +115,13 @@ def test_module_webdev_user_can_not_access(modules_dct, resp_webdev_user, slug):
115115
'pytools',
116116
'django',
117117
'entrevistas-tecnicas',
118-
])
119-
def test_module_bootcamper_user_can_access(modules_dct, resp_bootcamper_user, slug):
120-
""" Assert that user with a bootcamper role can access the right content """
121-
dj_assert_contains(resp_bootcamper_user, modules_dct[slug].get_absolute_url())
122-
123-
124-
@pytest.mark.parametrize('slug', [
125118
'objetos-pythonicos',
126119
'python-para-pythonistas',
127120
'python-patterns',
128121
])
129-
def test_module_bootcamper_user_can_not_access(modules_dct, resp_bootcamper_user, slug):
130-
""" Assert that user with a bootcamper role can not access some contents """
131-
dj_assert_not_contains(resp_bootcamper_user, modules_dct[slug].get_absolute_url())
122+
def test_module_bootcamper_user_can_access(modules_dct, resp_bootcamper_user, slug):
123+
""" Assert that user with a bootcamper role can access the right content """
124+
dj_assert_contains(resp_bootcamper_user, modules_dct[slug].get_absolute_url())
132125

133126

134127
@pytest.mark.parametrize('slug', [

0 commit comments

Comments
 (0)