|
3 | 3 | from django.urls import reverse |
4 | 4 | from model_mommy import mommy |
5 | 5 |
|
6 | | -from pythonpro.django_assertions import dj_assert_contains, dj_assert_template_used |
| 6 | +from pythonpro.django_assertions import dj_assert_contains, dj_assert_not_contains, dj_assert_template_used |
7 | 7 | from pythonpro.modules import facade |
8 | 8 | from pythonpro.modules.models import Chapter, Module, Section |
9 | 9 |
|
@@ -41,6 +41,21 @@ def test_lead_content(content, client_with_lead, modules): |
41 | 41 | dj_assert_contains(resp, content) |
42 | 42 |
|
43 | 43 |
|
| 44 | +def test_lead_has_no_automation_button(client_with_lead, modules, python_birds): |
| 45 | + resp = generate_resp('python-birds', client_with_lead) |
| 46 | + dj_assert_not_contains(resp, reverse('modules:enrol', kwargs={'slug': python_birds.slug})) |
| 47 | + |
| 48 | + |
| 49 | +def test_client_has_no_automation_button(client_with_client, modules, python_birds): |
| 50 | + resp = generate_resp('python-birds', client_with_client) |
| 51 | + dj_assert_contains(resp, reverse('modules:enrol', kwargs={'slug': python_birds.slug})) |
| 52 | + |
| 53 | + |
| 54 | +def test_member_has_no_automation_button(client_with_member, modules, python_birds): |
| 55 | + resp = generate_resp('python-birds', client_with_member) |
| 56 | + dj_assert_contains(resp, reverse('modules:enrol', kwargs={'slug': python_birds.slug})) |
| 57 | + |
| 58 | + |
44 | 59 | @pytest.mark.parametrize( |
45 | 60 | 'content', |
46 | 61 | [ |
@@ -124,10 +139,6 @@ def test_chapter_urls(resp_with_chapters, chapters): |
124 | 139 | dj_assert_contains(resp_with_chapters, chapter.get_absolute_url()) |
125 | 140 |
|
126 | 141 |
|
127 | | -def test_python_birds_enrol_link(resp_with_sections, python_birds): |
128 | | - dj_assert_contains(resp_with_sections, reverse('modules:enrol', kwargs={'slug': python_birds.slug})) |
129 | | - |
130 | | - |
131 | 142 | def test_enrol_user_tags(python_birds, client_with_lead, mocker, logged_user): |
132 | 143 | tag_as = mocker.patch('pythonpro.modules.modules_views.tag_as') |
133 | 144 | resp = client_with_lead.get(reverse('modules:enrol', kwargs={'slug': python_birds.slug}), secure=True) |
|
0 commit comments