def test_vimeo_player_not_present(resp_video_not_recorded): dj_assert_not_contains(resp_video_not_recorded, 'src="https://player.vimeo.com/video/"')
def test_last_topic(resp_last_topic): dj_assert_not_contains(resp_last_topic, 'Próximo Conteúdo')
def test_video_lead_form_not_present(content, video_resp_subscriptions_open): dj_assert_not_contains(video_resp_subscriptions_open, content)
def test_not_recorded_webinar_url_not_present(resp_not_recorded_webinars, not_recorded_webinars): for webinar in not_recorded_webinars: dj_assert_not_contains(resp_not_recorded_webinars, webinar.get_absolute_url())
def test_last_topic(resp_last_topic, topics): dj_assert_not_contains(resp_last_topic, 'Próximo Tópico')
def test_future_live_classes_urls_are_absent(resp_with_classes, future_live_classes): for live_class in future_live_classes: dj_assert_not_contains(resp_with_classes, live_class.get_absolute_url())
def test_payment_link_is_not_present(home_resp_closed_subscriptions): """ Assert Payment link is not present on home page when subscriptions are closed """ dj_assert_not_contains(home_resp_closed_subscriptions, reverse('member_landing_page'))
def test_module_link_not_logged(modules, resp_not_logged): """ Assert module links are not present when user is not logged """ for module in modules: dj_assert_not_contains(resp_not_logged, f'href="{module.get_absolute_url()}"')
def test_should_not_show_price_and_ctas(resp_with_countdown_expired): dj_assert_not_contains(resp_with_countdown_expired, '<!-- block price appearing -->') dj_assert_not_contains( resp_with_countdown_expired, '<button class="cta btn btn-warning initiate-checkout')
def test_first_topic(resp_last_topic): dj_assert_not_contains(resp_last_topic, 'Conteúdo Anterior')
def test_should_not_show_price_and_ctas(resp_with_countdown_expired): dj_assert_not_contains(resp_with_countdown_expired, '<!-- block price appearing -->') dj_assert_not_contains(resp_with_countdown_expired, '<button')
def test_should_not_show_login_form_when_user_is_logged(resp_with_lead): dj_assert_not_contains(resp_with_lead, 'login')
def test_video_subscription_link_not_present(video_resp): dj_assert_not_contains(video_resp, reverse('payments:options'))
def test_should_use_lead_form_with_no_offer(client): resp = client.get(reverse('core:lead_landing_with_no_offer')) dj_assert_not_contains(resp, reverse('core:lead_form') + '"') dj_assert_contains(resp, reverse('core:lead_form_with_no_offer'))
def test_forum_tab_is_not_present(home_resp): """ Assert Forum tab is no present when user is not logged in """ dj_assert_not_contains(home_resp, f'href="{settings.DISCOURSE_BASE_URL}"')
def test_should_use_lead_form_with_OTO(resp): dj_assert_contains(resp, reverse('core:lead_form')) dj_assert_not_contains(resp, reverse('core:lead_form_with_no_offer'))
def test_payment_link_is_not_present(home_resp_closed_subscriptions): """ Assert Payment link is not present on home page when subscriptions are closed """ dj_assert_not_contains(home_resp_closed_subscriptions, reverse('checkout:bootcamp_lp'))
def test_module_index_link_logged(resp): """ Assert module index link is not present when user is logged """ url = reverse('modules:index') dj_assert_not_contains(resp, f'href="{url}"')
def test_module_client_user_can_not_access(modules_dct, resp_client_user, slug): """ Assert that user with a client role can not access some contents """ dj_assert_not_contains(resp_client_user, modules_dct[slug].get_absolute_url())
def test_there_is_no_none_on_landing_page(resp): """ Assert there is no None field on home form """ dj_assert_not_contains(resp, 'value="None"')
def test_link_unavailable_for_non_users(client): resp = client.get('/') dj_assert_not_contains(resp, reverse('cohorts:webinars'))
def test_future_webnars_url_are_absent(resp_with_webnars, future_webinars): for webnar in future_webinars: dj_assert_not_contains(resp_with_webnars, webnar.get_absolute_url())
def test_lead_has_no_automation_button(client_with_lead, modules, python_birds): resp = generate_resp('python-birds', client_with_lead) dj_assert_not_contains( resp, reverse('modules:enrol', kwargs={'slug': python_birds.slug}))