Original price for variations (#1258)

* Original price for variations

* Documentation

* API-GET

* Fix existing tests to accomodate new attribute

* Test for variation's original_price on API
This commit is contained in:
Martin Gross
2019-04-18 16:13:49 +02:00
committed by GitHub
parent 4838835b1b
commit 2eb88840bd
9 changed files with 77 additions and 7 deletions

View File

@@ -319,6 +319,7 @@ def test_item_detail_variations(token_client, organizer, event, team, item):
"active": True,
"description": None,
"position": 0,
"original_price": None
}]
res["has_variations"] = True
resp = token_client.get('/api/v1/organizers/{}/events/{}/items/{}/'.format(organizer.slug, event.slug,
@@ -941,7 +942,8 @@ TEST_VARIATIONS_RES = {
"description": None,
"position": 0,
"default_price": None,
"price": "23.00"
"price": "23.00",
"original_price": None
}
TEST_VARIATIONS_UPDATE = {
@@ -952,6 +954,7 @@ TEST_VARIATIONS_UPDATE = {
"description": None,
"position": 1,
"default_price": "20.0",
"original_price": None
}
@@ -987,6 +990,7 @@ def test_variations_create(token_client, organizer, event, item, variation):
"description": None,
"position": 1,
"default_price": None,
"original_price": "23.42",
"price": 23.0
},
format='json'
@@ -1025,6 +1029,7 @@ def test_variations_update(token_client, organizer, event, item, item3, variatio
res["id"] = variation.pk
res["price"] = "20.00"
res["default_price"] = "20.00"
res["original_price"] = "50.00"
resp = token_client.patch(
'/api/v1/organizers/{}/events/{}/items/{}/variations/{}/'.format(organizer.slug, event.slug, item.pk, variation.pk),
{
@@ -1032,7 +1037,8 @@ def test_variations_update(token_client, organizer, event, item, item3, variatio
"en": "ChildC2"
},
"position": 1,
"default_price": "20.00"
"default_price": "20.00",
"original_price": "50.00"
},
format='json'
)