Esempio n. 1
0
def test_title(resp, section, property_name):
    dj_assert_contains(resp, getattr(section, property_name))
Esempio n. 2
0
def test_basic_contents(resp, webinar, property_name):
    dj_assert_contains(resp, getattr(webinar, property_name))
Esempio n. 3
0
def test_subscription_link_is_present(resp):
    dj_assert_contains(resp, reverse('checkout:bootcamp_lp'))
Esempio n. 4
0
def test_max_creation(resp, interactions):
    tz = timezone.get_current_timezone()
    last_interaction_utc = datetime(2019, 7, 22, 1, 0, 0, tzinfo=pytz.utc)
    last_interaction_local = last_interaction_utc.astimezone(tz).strftime(
        '%d/%m/%Y %H:%M:%S')
    dj_assert_contains(resp, last_interaction_local)
Esempio n. 5
0
def test_total_watched_time(resp, interactions: List[TopicInteraction]):
    total_watched_time = sum(interaction.total_watched_time
                             for interaction in interactions)
    total_watched_time_str = duration(total_watched_time)
    dj_assert_contains(resp, total_watched_time_str)
Esempio n. 6
0
def test_topic_title_is_present(resp, topic):
    dj_assert_contains(resp, topic.title)
Esempio n. 7
0
def test_topic_url(resp, topic: Topic):
    dj_assert_contains(resp, topic.get_absolute_url())
Esempio n. 8
0
def test_cohort_url(cohort: Cohort, resp):
    dj_assert_contains(resp, cohort.get_absolute_url())
Esempio n. 9
0
def test_payment_link_is_present(home_resp_open_subscriptions):
    """
    Assert Payment link is present on home page when subscriptions are open
    """
    dj_assert_contains(home_resp_open_subscriptions,
                       reverse('member_landing_page'))
Esempio n. 10
0
def test_cohort_title(cohort, resp):
    dj_assert_contains(resp, cohort.title)
Esempio n. 11
0
def test_pending_live_class_msg(resp_video_not_recorded):
    dj_assert_contains(
        resp_video_not_recorded,
        'Ainda não temos máquina do tempo, essa aula ainda não foi gravada')

    dj_assert_contains(resp_video_not_recorded, 'Retornar à página da turma')
Esempio n. 12
0
def test_basic_contents(resp, live_class, property_name):
    dj_assert_contains(resp, getattr(live_class, property_name))
Esempio n. 13
0
def test_breadcrumb_current(resp, section):
    dj_assert_contains(
        resp,
        f'<li class="breadcrumb-item active" aria-current="page">{section.title}</li>'
    )
Esempio n. 14
0
def test_breadcrumb_parent(resp, module):
    dj_assert_contains(
        resp,
        f'<li class="breadcrumb-item"><a href="{module.get_absolute_url()}">{module.title}</a></li>'
    )
Esempio n. 15
0
def test_should_set_date_by_url(client):
    resp = client.get(
        reverse('pages:tpp_webiorico_landing_page_date_var', args=['13-10']))

    assert resp.status_code == 200
    dj_assert_contains(resp, '13/10')
Esempio n. 16
0
def test_email_field_is_present(resp):
    dj_assert_contains(resp, 'https://python.activehosted.com/f/embed.php?id=2')
Esempio n. 17
0
def test_not_existing_aggregation_msg_is_present(resp_without_interactions,
                                                 topic):
    dj_assert_contains(resp_without_interactions,
                       "Ainda não existem dados agregados")
Esempio n. 18
0
def test_redirect_javascript_url_with_query_string(resp_javascript,
                                                   redirect_javascript):
    dj_assert_contains(
        resp_javascript,
        f'{redirect_javascript.links.first().url}?utm_source=facebook')
Esempio n. 19
0
def test_table_instructions(resp, topic):
    dj_assert_contains(resp, 'Confira os dados consolidados por tópico')
Esempio n. 20
0
def test_payment_link_is_present(home_resp_open_subscriptions):
    """
    Assert Payment link is present on home page when subscriptions are open
    """
    dj_assert_contains(home_resp_open_subscriptions,
                       reverse('checkout:bootcamp_lp'))
Esempio n. 21
0
def test_module_table_row(resp, topic: Topic):
    module = topic.find_module()
    dj_assert_contains(
        resp, f'<a href="{module.get_absolute_url()}">{module.title}</a>')
Esempio n. 22
0
def test_subscription_link_is_present(resp):
    dj_assert_contains(resp, reverse('payments:waiting_list_ty'))
Esempio n. 23
0
def test_max_watched_time(resp, interactions: List[TopicInteraction]):
    max_watched_time = max(interaction.max_watched_time
                           for interaction in interactions)
    max_watched_time_str = duration(max_watched_time)
    dj_assert_contains(resp, max_watched_time_str)
def test_module_pythonista_user_can_access(modules_dct, resp_pythonista_user,
                                           slug):
    """ Assert that user with a pythonista role can access the right content """
    dj_assert_contains(resp_pythonista_user,
                       modules_dct[slug].get_absolute_url())
Esempio n. 25
0
def test_interactions_count(resp, interactions: List[TopicInteraction]):
    interactions_count = len(interactions)
    dj_assert_contains(resp, f'<td>{interactions_count}</td>')
def test_module_member_user_can_access(modules_dct, resp_member_user, slug):
    """ Assert that user with a member role can access all the content """
    dj_assert_contains(resp_member_user, modules_dct[slug].get_absolute_url())
Esempio n. 27
0
def test_pending_webinar_msg(resp_video_not_recorded):
    dj_assert_contains(
        resp_video_not_recorded,
        'Ainda não temos máquina do tempo, esse webinário ainda não foi gravado'
    )
def test_module_lead_user_can_access(modules_dct, resp_lead_user):
    """ Assert that user with a lead role can access the right content """
    python_birds = modules_dct['python-birds']
    dj_assert_contains(resp_lead_user,
                       f'href="{python_birds.get_absolute_url()}"')
Esempio n. 29
0
def test_module_bootcamper_user_can_access(modules_dct, resp_bootcamper_user,
                                           slug):
    """ Assert that user with a bootcamper role can access the right content """
    dj_assert_contains(resp_bootcamper_user,
                       modules_dct[slug].get_absolute_url())
Esempio n. 30
0
def test_page_content(content, login_get_resp):
    dj_assert_contains(login_get_resp, content)