|
2 | 2 | from django.core.management import call_command |
3 | 3 | from django.urls import reverse |
4 | 4 |
|
5 | | -from pythonpro.django_assertions import dj_assert_contains, dj_assert_not_contains |
| 5 | +from pythonpro.django_assertions import dj_assert_contains |
6 | 6 | from pythonpro.modules import facade |
7 | 7 |
|
8 | 8 |
|
@@ -56,104 +56,3 @@ def test_module_lead_user_can_access(modules_dct, resp_lead_user): |
56 | 56 | """ Assert that user with a lead role can access the right content """ |
57 | 57 | python_birds = modules_dct['python-birds'] |
58 | 58 | dj_assert_contains(resp_lead_user, f'href="{python_birds.get_absolute_url()}"') |
59 | | - |
60 | | - |
61 | | -@pytest.mark.parametrize('slug', [ |
62 | | - 'objetos-pythonicos', |
63 | | - 'pytools', |
64 | | - 'python-para-pythonistas', |
65 | | - 'django', |
66 | | - 'python-patterns', |
67 | | - 'entrevistas-tecnicas', |
68 | | -]) |
69 | | -def test_module_lead_user_can_not_access(modules_dct, resp_lead_user, slug): |
70 | | - """ Assert that user with a lead role can not access some contents """ |
71 | | - dj_assert_not_contains(resp_lead_user, modules_dct[slug].get_absolute_url()) |
72 | | - |
73 | | - |
74 | | -@pytest.mark.parametrize('slug', ['python-birds', 'pytools']) |
75 | | -def test_module_client_user_can_access(modules_dct, resp_client_user, slug): |
76 | | - """ Assert that user with a client role can access the right content """ |
77 | | - dj_assert_contains(resp_client_user, modules_dct[slug].get_absolute_url()) |
78 | | - |
79 | | - |
80 | | -@pytest.mark.parametrize('slug', [ |
81 | | - 'django', |
82 | | - 'objetos-pythonicos', |
83 | | - 'python-para-pythonistas', |
84 | | - 'python-patterns', |
85 | | - 'entrevistas-tecnicas', |
86 | | -]) |
87 | | -def test_module_client_user_can_not_access(modules_dct, resp_client_user, slug): |
88 | | - """ Assert that user with a client role can not access some contents """ |
89 | | - dj_assert_not_contains(resp_client_user, modules_dct[slug].get_absolute_url()) |
90 | | - |
91 | | - |
92 | | -@pytest.mark.parametrize('slug', [ |
93 | | - 'python-birds', |
94 | | - 'pytools', |
95 | | - 'django', |
96 | | - 'entrevistas-tecnicas', |
97 | | -]) |
98 | | -def test_module_webdev_user_can_access(modules_dct, resp_webdev_user, slug): |
99 | | - """ Assert that user with a webdev role can access the right content """ |
100 | | - dj_assert_contains(resp_webdev_user, modules_dct[slug].get_absolute_url()) |
101 | | - |
102 | | - |
103 | | -@pytest.mark.parametrize('slug', [ |
104 | | - 'objetos-pythonicos', |
105 | | - 'python-para-pythonistas', |
106 | | - 'python-patterns', |
107 | | -]) |
108 | | -def test_module_webdev_user_can_not_access(modules_dct, resp_webdev_user, slug): |
109 | | - """ Assert that user with a webdev role can not access some contents """ |
110 | | - dj_assert_not_contains(resp_webdev_user, modules_dct[slug].get_absolute_url()) |
111 | | - |
112 | | - |
113 | | -@pytest.mark.parametrize('slug', [ |
114 | | - 'python-birds', |
115 | | - 'pytools', |
116 | | - 'django', |
117 | | - 'entrevistas-tecnicas', |
118 | | - 'objetos-pythonicos', |
119 | | - 'python-para-pythonistas', |
120 | | - 'python-patterns', |
121 | | -]) |
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()) |
125 | | - |
126 | | - |
127 | | -@pytest.mark.parametrize('slug', [ |
128 | | - 'python-birds', |
129 | | - 'objetos-pythonicos', |
130 | | - 'python-para-pythonistas', |
131 | | - 'python-patterns', |
132 | | -]) |
133 | | -def test_module_pythonista_user_can_access(modules_dct, resp_pythonista_user, slug): |
134 | | - """ Assert that user with a pythonista role can access the right content """ |
135 | | - dj_assert_contains(resp_pythonista_user, modules_dct[slug].get_absolute_url()) |
136 | | - |
137 | | - |
138 | | -@pytest.mark.parametrize('slug', [ |
139 | | - 'pytools', |
140 | | - 'django', |
141 | | - 'entrevistas-tecnicas', |
142 | | -]) |
143 | | -def test_module_pythonista_user_can_not_access(modules_dct, resp_pythonista_user, slug): |
144 | | - """ Assert that user with a pythonista role can not access some contents """ |
145 | | - dj_assert_not_contains(resp_pythonista_user, modules_dct[slug].get_absolute_url()) |
146 | | - |
147 | | - |
148 | | -@pytest.mark.parametrize('slug', [ |
149 | | - 'pytools', |
150 | | - 'django', |
151 | | - 'entrevistas-tecnicas', |
152 | | - 'python-birds', |
153 | | - 'objetos-pythonicos', |
154 | | - 'python-para-pythonistas', |
155 | | - 'python-patterns', |
156 | | -]) |
157 | | -def test_module_member_user_can_access(modules_dct, resp_member_user, slug): |
158 | | - """ Assert that user with a member role can access all the content """ |
159 | | - dj_assert_contains(resp_member_user, modules_dct[slug].get_absolute_url()) |
0 commit comments