Esempio n. 1
0
 def test_valid_data(self):
     task = ModelFactory.make('Task')
     blank_form = TaskForm()
     index = int(len(blank_form.fields['cogat_id'].choices) * 
         random.random())
     form = TaskForm({
         'cogat_id': blank_form.fields['cogat_id']._get_choices()[index][0],
         'number': task.number
     })
     self.assertTrue(form.is_valid())
Esempio n. 2
0
 def test_valid_data(self):
     task = ModelFactory.make('Task')
     blank_form = TaskForm()
     index = int(
         len(blank_form.fields['cogat_id'].choices) * random.random())
     form = TaskForm({
         'cogat_id':
         blank_form.fields['cogat_id']._get_choices()[index][0],
         'number':
         task.number
     })
     self.assertTrue(form.is_valid())
Esempio n. 3
0
 def test_blank_data(self):
     form = TaskForm({})
     self.assertFalse(form.is_valid())
Esempio n. 4
0
 def test_blank_data(self):
     form = TaskForm({})
     self.assertFalse(form.is_valid())