Пример #1
0
def test__original_active_ingredient_list__200_response_via_name(user):
    """Test for 200 response for the OriginalActiveIngredient List page via name."""
    # Add permission to user
    utils.add_web_view_permission(user)

    # Set up client and response
    client = Client()
    client.force_login(user=user)
    response = client.get(reverse('hc_dpd:original_active_ingredient_list'))

    assert response.status_code == 200
Пример #2
0
def test__original_biosimilar_list__context(user):
    """Confirms OriginalBiosimilarList view returns expected context name."""
    # Add permission to user
    utils.add_web_view_permission(user)

    # Set up client and response
    client = Client()
    client.force_login(user=user)
    response = client.get(reverse('hc_dpd:original_biosimilar_list'))

    # Test for context key
    assert 'biosimilar_list' in response.context
Пример #3
0
def test__dpd_list__template(user):
    """Test for proper template in DPDList views."""
    # Add permission to user
    utils.add_web_view_permission(user)

    # Set up client and response
    client = Client()
    client.force_login(user=user)
    response = client.get(reverse('hc_dpd:dpd_list'))

    # Test for template
    assert ('hc_dpd/dpd_list.html' in [t.name for t in response.templates])
Пример #4
0
def test__original_active_ingredient_list__200_response_via_url(user):
    """Tests for 200 response for the OriginalActiveIngredient List page via URL."""
    # Add permission to user
    utils.add_web_view_permission(user)

    # Create client and force user login
    client = Client()
    client.force_login(user=user)

    # Test GET request
    response = client.get('/tools/dpd/active-ingredient/')

    assert response.status_code == 200
Пример #5
0
def test__original_veterinary_species_list__200_response_via_url(user):
    """Tests for 200 response for the OriginalVeterinarySpecies List page via URL."""
    # Add permission to user
    utils.add_web_view_permission(user)

    # Create client and force user login
    client = Client()
    client.force_login(user=user)

    # Test GET request
    response = client.get('/tools/dpd/veterinary-species/')

    assert response.status_code == 200
Пример #6
0
def test__original_therapeutic_class_list__200_response_via_url(user):
    """Tests for 200 response for the OriginalTherapeuticClass List page via URL."""
    # Add permission to user
    utils.add_web_view_permission(user)

    # Create client and force user login
    client = Client()
    client.force_login(user=user)

    # Test GET request
    response = client.get('/tools/dpd/therapeutic-class/')

    assert response.status_code == 200
Пример #7
0
def test__dpd_list__200_response_via_url(user):
    """Tests for 200 response for the DPD list page via URL."""
    # Add permission to user
    utils.add_web_view_permission(user)

    # Create client and force user login
    client = Client()
    client.force_login(user=user)

    # Test GET request
    response = client.get('/tools/dpd/dpd/')

    assert response.status_code == 200
Пример #8
0
def test__original_active_ingredient_list__template(user):
    """Test for proper template in OriginalActiveIngredientList views."""
    # Add permission to user
    utils.add_web_view_permission(user)

    # Set up client and response
    client = Client()
    client.force_login(user=user)
    response = client.get(reverse('hc_dpd:original_active_ingredient_list'))

    # Test for template
    assert ('hc_dpd/originalactiveingredient_list.html'
            in [t.name for t in response.templates])
Пример #9
0
def test__original_veterinary_species_list__template(user):
    """Test for proper template in OriginalVeterinarySpeciesList views."""
    # Add permission to user
    utils.add_web_view_permission(user)

    # Set up client and response
    client = Client()
    client.force_login(user=user)
    response = client.get(reverse('hc_dpd:original_veterinary_species_list'))

    # Test for template
    assert ('hc_dpd/originalveterinaryspecies_list.html'
            in [t.name for t in response.templates])
Пример #10
0
def test__original_therapeutic_class_list__template(user):
    """Test for proper template in OriginalTherapeuticClassList views."""
    # Add permission to user
    utils.add_web_view_permission(user)

    # Set up client and response
    client = Client()
    client.force_login(user=user)
    response = client.get(reverse('hc_dpd:original_therapeutic_class_list'))

    # Test for template
    assert ('hc_dpd/originaltherapeuticclass_list.html'
            in [t.name for t in response.templates])
Пример #11
0
def test__original_pharmaceutical_standard_list__template(user):
    """Test for proper template in OriginalPharmaceuticalStandardList views."""
    # Add permission to user
    utils.add_web_view_permission(user)

    # Set up client and response
    client = Client()
    client.force_login(user=user)
    response = client.get(
        reverse('hc_dpd:original_pharmaceutical_standard_list'))

    # Test for template
    assert ('hc_dpd/originalpharmaceuticalstandard_list.html'
            in [t.name for t in response.templates])