Exemple #1
0
 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
Exemple #2
0
 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
Exemple #3
0
 def test_find_by_id_with_instance(self):
     of = OfferFactory()
     self.assertEqual(of, offer.find_by_id(of.pk))
Exemple #4
0
 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)