Example #1
0
 def test_offer_type(self):
     offer = models.Offer(type=str(ThingType.LIVRE_EDITION))
     assert offer.offerType == {
         "conditionalFields": ["author", "isbn"],
         "proLabel": "Livres papier ou numérique, abonnements lecture",
         "appLabel": "Livre ou carte lecture",
         "offlineOnly": False,
         "onlineOnly": False,
         "sublabel": "Lire",
         "description": "S’abonner à un quotidien d’actualité ?"
         " À un hebdomadaire humoristique ? "
         "À un mensuel dédié à la nature ? "
         "Acheter une BD ou un manga ? "
         "Ou tout simplement ce livre dont tout le monde parle ?",
         "value": "ThingType.LIVRE_EDITION",
         "type": "Thing",
         "isActive": True,
         "canExpire": True,
     }
Example #2
0
 def test_offer_category(self):
     offer = models.Offer(type=str(ThingType.JEUX_VIDEO))
     assert offer.offer_category == "JEUX_VIDEO"
Example #3
0
 def test_is_digital(self):
     offer = models.Offer(url="")
     assert not offer.isDigital
     offer.url = "http://example.com/offer"
     assert offer.isDigital
Example #4
0
 def test_defaults_to_none(self):
     offer = models.Offer()
     assert offer.thumbUrl == None