Fix unit tests
This commit is contained in:
parent
0c5e48aa30
commit
418eba5623
|
|
@ -6,6 +6,8 @@ from rest_framework.test import APITestCase
|
|||
|
||||
from vbv_lernwelt.core.admin import User
|
||||
from vbv_lernwelt.core.model_utils import add_countries
|
||||
from vbv_lernwelt.learnpath.consts import COURSE_PROFILE_ALL_CODE, COURSE_PROFILE_ALL_ID
|
||||
from vbv_lernwelt.learnpath.models import CourseProfile
|
||||
from vbv_lernwelt.shop.const import VV_DE_PRODUCT_SKU
|
||||
from vbv_lernwelt.shop.models import CheckoutInformation, CheckoutState, Product
|
||||
from vbv_lernwelt.shop.services import InitTransactionException
|
||||
|
|
@ -50,6 +52,10 @@ class CheckoutAPITestCase(APITestCase):
|
|||
is_active=True,
|
||||
)
|
||||
|
||||
CourseProfile.objects.get_or_create(
|
||||
id=COURSE_PROFILE_ALL_ID, code=COURSE_PROFILE_ALL_CODE
|
||||
)
|
||||
|
||||
self.client.login(username=USER_USERNAME, password=USER_PASSWORD)
|
||||
add_countries(small_set=True)
|
||||
|
||||
|
|
|
|||
|
|
@ -94,7 +94,7 @@ def checkout_vv(request):
|
|||
|
||||
sku = request.data["product"]
|
||||
base_redirect_url = request.data["redirect_url"]
|
||||
chosen_profile_id = request.data["chosen_profile"]
|
||||
chosen_profile_id = request.data.get("chosen_profile", COURSE_PROFILE_ALL_ID)
|
||||
|
||||
log.info("Checkout requested: sku", user_id=request.user.id, sku=sku)
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue