@@ -184,11 +184,11 @@ def test_welcome_message(self, welcome_message_is_dismissed):
184184 assert welcome_message_html == (None if welcome_message_is_dismissed else '<p>Welcome</p>' )
185185
186186 @ddt .data (
187- (False , 'EDXWELCOME' ),
188- (True , 'NOTEDXWELCOME' ),
187+ (False , 'EDXWELCOME' , 15 ),
188+ (True , 'NOTEDXWELCOME' , 30 ),
189189 )
190190 @ddt .unpack
191- def test_offer (self , is_fpd_override_waffle_flag_on , fpd_code ):
191+ def test_offer (self , is_fpd_override_waffle_flag_on , fpd_code , fpd_percentage ):
192192 """
193193 Test that the offer data contains the correct code for the first purchase discount,
194194 which can be overriden via a waffle flag from the default EDXWELCOME.
@@ -199,12 +199,16 @@ def test_offer(self, is_fpd_override_waffle_flag_on, fpd_code):
199199 assert response .data ['offer' ] is None
200200
201201 with override_settings (FIRST_PURCHASE_DISCOUNT_OVERRIDE_CODE = 'NOTEDXWELCOME' ):
202- with override_waffle_flag (DISCOUNT_APPLICABILITY_FLAG , active = True ):
203- with override_waffle_flag (FIRST_PURCHASE_DISCOUNT_OVERRIDE_FLAG , active = is_fpd_override_waffle_flag_on ):
204- response = self .client .get (self .url )
205-
206- # Just a quick spot check that the dictionary looks like what we expect
207- assert response .data ['offer' ]['code' ] == fpd_code
202+ with override_settings (FIRST_PURCHASE_DISCOUNT_OVERRIDE_PERCENTAGE = fpd_percentage ):
203+ with override_waffle_flag (DISCOUNT_APPLICABILITY_FLAG , active = True ):
204+ with override_waffle_flag (
205+ FIRST_PURCHASE_DISCOUNT_OVERRIDE_FLAG , active = is_fpd_override_waffle_flag_on
206+ ):
207+ response = self .client .get (self .url )
208+
209+ # Just a quick spot check that the dictionary looks like what we expect
210+ assert response .data ['offer' ]['code' ] == fpd_code
211+ assert response .data ['offer' ]['percentage' ] == fpd_percentage
208212
209213 def test_access_expiration (self ):
210214 enrollment = CourseEnrollment .enroll (self .user , self .course .id , CourseMode .VERIFIED )
0 commit comments