@@ -219,7 +219,7 @@ def test_queue_delete_all():
219219#
220220def test_installments_list ():
221221 """Should return a list of queued resources"""
222- eq_ (list , type (mango .Queue .list ()))
222+ eq_ (list , type (mango .Installments .list ()))
223223
224224
225225def test_installments_list_filters ():
@@ -228,3 +228,30 @@ def test_installments_list_filters():
228228 for installment in installments :
229229 eq_ ("visa" , installment .get ("cardtype" ))
230230 eq_ (5000 , installment .get ("amount" ))
231+
232+
233+ #
234+ # Promotions
235+ #
236+ def test_promotions_list ():
237+ """Should return a list of promotion resources"""
238+ eq_ (list , type (mango .Promotions .list ()))
239+
240+
241+ def test_promotions_list_filters ():
242+ """Should return a filtered list of promotions resources"""
243+ promotions = mango .Promotions .list (status = "active" )
244+ for promotion in promotions :
245+ eq_ ("active" , promotion .get ("status" ))
246+ ok_ (promotion .get ("name" ))
247+ ok_ (promotion .get ("valid_to" ))
248+ ok_ (promotion .get ("valid_from" ))
249+
250+
251+ def test_promotions_get_item ():
252+ """Should return a single promotion resource"""
253+ promotion_uid = mango .Promotions .list (status = "active" )[0 ].get ("uid" )
254+ promotion = mango .Promotions .get (promotion_uid )
255+ ok_ (promotion )
256+ eq_ (promotion_uid , promotion .get ("uid" ))
257+ eq_ ("active" , promotion .get ("status" ))
0 commit comments