def orientation_sibling(self): if self.offer: off = offer.find_by_id(self.offer.id) return OfferYear.objects.filter( offer=off, acronym=self.acronym, academic_year=self.academic_year).exclude(id=self.id) return None
def orientation_sibling(self): if self.offer: off = offer.find_by_id(self.offer.id) return OfferYear.objects.filter(offer=off, acronym=self.acronym, academic_year=self.academic_year).exclude(id=self.id) return None
def test_find_by_id_with_instance(self): of = OfferFactory() self.assertEqual(of, offer.find_by_id(of.pk))
def test_find_by_id_none(self): self.assertIsNone(offer.find_by_id(-1))
def test_find_by_id(self): self.assertEqual(mdl_offer.find_by_id(self.offer.id), self.offer)