Esempio n. 1
0
def test_get_organization(site_settings):
    example_name = "Saleor Brand Name"
    site = site_settings.site
    site.name = example_name
    site.save()

    result = get_organization()
    assert result["name"] == example_name
Esempio n. 2
0
def test_get_organization(site_settings):
    example_name = 'Saleor Brand Name'
    site = site_settings.site
    site.name = example_name
    site.save()

    result = get_organization()
    assert result['name'] == example_name
def test_get_product_data_with_image(order_with_lines, product_with_image):
    order_line = order_with_lines.lines.first()
    order_line.product = product_with_image
    order_line.product_name = product_with_image.name
    order_line.save()
    organization = get_organization()
    result = get_product_data(order_line, organization)
    assert 'image' in result['itemOffered']
    assert result['itemOffered']['name'] == product_with_image.name
def test_get_product_data_with_image(order_with_lines, product_with_image):
    line = order_with_lines.lines.first()
    variant = product_with_image.variants.first()
    line.variant = variant
    line.product_name = variant.display_product()
    line.save()
    organization = get_organization()
    result = get_product_data(line, organization)
    assert "image" in result["itemOffered"]
    assert result["itemOffered"]["name"] == variant.display_product()
Esempio n. 5
0
def test_get_product_data_with_image(order_with_lines, product_with_image):
    line = order_with_lines.lines.first()
    variant = product_with_image.variants.first()
    line.variant = variant
    line.product_name = variant.display_product()
    line.save()
    organization = get_organization()
    result = get_product_data(line, organization)
    assert 'image' in result['itemOffered']
    assert result['itemOffered']['name'] == variant.display_product()
Esempio n. 6
0
def test_get_product_data_without_line_variant(order_with_lines):
    """Tested OrderLine Product has no image assigned."""
    line = order_with_lines.lines.first()
    organization = get_organization()
    line.variant = None
    line.save()

    assert not line.variant
    result = get_product_data(line, organization)

    assert result == {}
Esempio n. 7
0
def test_get_product_data_with_image(order_with_lines_and_stock,
                                     product_with_image):
    order = order_with_lines_and_stock
    order_line = order.lines.first()
    variant = product_with_image.variants.first()
    order_line.variant = variant
    order_line.product_name = variant.display_product()
    order_line.save()
    organization = get_organization()
    result = get_product_data(order_line, organization)
    assert 'image' in result['itemOffered']
    assert result['itemOffered']['name'] == variant.display_product()
Esempio n. 8
0
def test_get_product_data_without_image(order_with_lines):
    """Tested OrderLine Product has no image assigned."""
    line = order_with_lines.lines.first()
    organization = get_organization()
    result = get_product_data(line, organization)
    assert "image" not in result["itemOffered"]
Esempio n. 9
0
def test_get_product_data_without_image(order_with_lines_and_stock):
    """Tested OrderLine Product has no image assigned."""
    order_line = order_with_lines_and_stock.lines.first()
    organization = get_organization()
    result = get_product_data(order_line, organization)
    assert 'image' not in result['itemOffered']
Esempio n. 10
0
def test_get_product_data_without_image(order_with_lines_and_stock):
    """Tested OrderLine Product has no image assigned."""
    order_line = order_with_lines_and_stock.lines.first()
    organization = get_organization()
    result = get_product_data(order_line, organization)
    assert 'image' not in result['itemOffered']