def test_search_too_many_results(self): random_luy = LearningUnitYearFactory() form = LearningUnitYearForm( data={ 'acronym': random_luy.acronym, 'academic_year_id': random_luy.academic_year.pk }) form.MAX_RECORDS = 0 self.assertTrue(form.is_valid()) with self.assertRaises(TooManyResultsException): form.get_learning_units()
def test_search_too_many_results_is_not_raised_when_borrowed_course_search( self): random_luy = LearningUnitYearFactory( academic_year=self.academic_years[0]) form = LearningUnitYearForm(data={ 'acronym': random_luy.acronym, 'academic_year_id': random_luy.academic_year.pk }, borrowed_course_search=True) form.MAX_RECORDS = 0 self.assertTrue(form.is_valid()) form.get_learning_units()