Example #1
0
 def test_reporting_period_with_less_than_min_hours_failure(self):
     """ Test the timecard form when the reporting period requires at least
     16 hours to be reported and the hours entered are less than 16"""
     form_data = self.form_data()
     form_data['timecardobjects-0-hours_spent'] = '5'
     form_data['timecardobjects-1-hours_spent'] = '5'
     formset = TimecardFormSet(form_data)
     formset.set_min_working_hours(16)
     self.assertFalse(formset.is_valid())
Example #2
0
 def test_reporting_period_with_less_than_min_hours_success_save_mode(self):
     """ Test the timecard form when the reporting period is less than
     minimum required hours a period and you save (not submit) """
     form_data = self.form_data()
     form_data['timecardobjects-0-hours_spent'] = '5'
     form_data['timecardobjects-1-hours_spent'] = '5'
     formset = TimecardFormSet(form_data)
     formset.set_min_working_hours(16)
     formset.save_only = True
     self.assertTrue(formset.is_valid())