def test_listing_country_is_none(self): listing = EquipmentGenerators.equipment_brand_listing() telescope = Generators.telescope() telescope.equipment_brand_listings.add(listing) self.assertEquals(0, equipment_brand_listings(telescope, None).count())
def test_listing_no_country(self): listing = EquipmentGenerators.equipment_brand_listing() telescope = Generators.telescope() telescope.equipment_brand_listings.add(listing) self.assertEquals(1, equipment_brand_listings(telescope, 'us').count())
def test_listing_correct_country(self): listing = EquipmentGenerators.equipment_brand_listing() listing.retailer.countries = "us" listing.retailer.save() telescope = Generators.telescope() telescope.equipment_brand_listings.add(listing) self.assertEquals(1, equipment_brand_listings(telescope, 'us').count())
def test_listing_in_wrong_country(self): listing = EquipmentGenerators.equipment_brand_listing() listing.retailer.countries = "it,ch,fi" listing.retailer.save() telescope = Generators.telescope() telescope.equipment_brand_listings.add(listing) self.assertEqual(0, equipment_brand_listings(telescope, 'us').count())
def test_no_listings(self): telescope = Generators.telescope() self.assertEquals(0, equipment_brand_listings(telescope, 'us').count())