Esempio n. 1
0
def assert_user_promoted(user, slug):
    if slug.startswith('membership'):
        assert core_facade.is_member(user)
    elif slug.startswith('webdev'):
        assert core_facade.is_webdev(user)
    elif slug.startswith('data-science'):
        assert core_facade.is_data_scientist(user)
    elif slug.startswith('bootcamp'):
        assert core_facade.is_bootcamper(user)
    else:
        pytest.fail(f'Invalid slug prefix {slug}')
Esempio n. 2
0
def assert_user_promoted(user, slug):
    if slug.startswith('membership'):
        assert core_facade.is_member(user)
    elif slug.startswith('webdev') or slug == 'treinamento-devpro-webinar':
        assert core_facade.is_webdev(user)
    elif slug.startswith('data-science'):
        assert core_facade.is_data_scientist(user)
    elif slug in {'bootcamp', 'bootcamp-webdev'}:
        assert core_facade.is_bootcamper(user)
        assert core_facade.is_pythonista(
            user)  # bonus because of full paid price
    elif slug.startswith('bootcamp'):
        assert core_facade.is_bootcamper(user)
    elif slug == 'pacote-proximo-nivel-67-discount':
        assert core_facade.is_pythonista(user)
    else:
        pytest.fail(f'Invalid slug prefix {slug}')
def test_logged_user_become_member(resp_logged_user, logged_user):
    assert core_facade.is_member(logged_user)
def test_user_is_member(resp, django_user_model):
    User = django_user_model
    user = User.objects.first()
    assert core_facade.is_member(user)