Esempio n. 1
0
def test_currently_used_countries():
    zone_1 = ShippingZone.objects.create(name='Zone 1', countries=['PL'])
    zone_2 = ShippingZone.objects.create(name='Zone 2', countries=['DE'])
    result = currently_used_countries(zone_1.pk)
    assert list(result)[0][0] == 'DE'
Esempio n. 2
0
def test_get_available_countries(shipping_zone):
    assert get_available_countries(shipping_zone.pk) == set(COUNTRY_CHOICES)
    assert get_available_countries() == (
        set(COUNTRY_CHOICES) - currently_used_countries())
Esempio n. 3
0
def test_currently_used_countries():
    zone_1 = ShippingZone.objects.create(name="Zone 1", countries=["PL"])
    ShippingZone.objects.create(name="Zone 2", countries=["DE"])
    result = currently_used_countries(zone_1.pk)
    assert list(result)[0][0] == "DE"
Esempio n. 4
0
def test_get_available_countries(shipping_zone):
    assert get_available_countries(shipping_zone.pk) == set(COUNTRY_CHOICES)
    assert get_available_countries() == (set(COUNTRY_CHOICES) -
                                         currently_used_countries())
Esempio n. 5
0
def test_currently_used_countries():
    zone_1 = ShippingZone.objects.create(name="Zone 1", countries=["PL"])
    ShippingZone.objects.create(name="Zone 2", countries=["DE"])
    result = currently_used_countries(zone_1.pk)
    assert list(result)[0][0] == "DE"
Esempio n. 6
0
def test_currently_used_countries():
    zone_1 = ShippingZone.objects.create(name='Zone 1', countries=['PL'])
    zone_2 = ShippingZone.objects.create(name='Zone 2', countries=['DE'])
    result = currently_used_countries(zone_1.pk)
    assert list(result)[0][0] == 'DE'