Ejemplo n.º 1
0
    def test_empty(self):
        with self.assertRaises(importer.ValidationError):
            importer.validate_questions({})

        with self.assertRaises(importer.ValidationError):
            importer.validate_questions({'key': 'value'})
Ejemplo n.º 2
0
 def test_invalid_question(self, test_patch):
     with self.assertRaises(importer.ValidationError):
         importer.validate_questions({'questions': [{'question': 'test'}]})
Ejemplo n.º 3
0
 def test_valid(self, test_patch):
     # Check to see that exception are raised
     importer.validate_questions({'questions': [{'something': 1}]})
Ejemplo n.º 4
0
 def test_not_list(self):
     with self.assertRaises(importer.ValidationError):
         importer.validate_questions({'questions': 'value'})
Ejemplo n.º 5
0
 def test_empty_list(self):
     with self.assertRaises(importer.ValidationError):
         importer.validate_questions({'questions': []})
Ejemplo n.º 6
0
    def test_empty(self):
        with self.assertRaises(importer.ValidationError):
            importer.validate_questions({})

        with self.assertRaises(importer.ValidationError):
            importer.validate_questions({'key': 'value'})
Ejemplo n.º 7
0
 def test_valid(self, test_patch):
     # Check to see that exception are raised
     importer.validate_questions({'questions': [{'something': 1}]})
Ejemplo n.º 8
0
 def test_invalid_question(self, test_patch):
     with self.assertRaises(importer.ValidationError):
         importer.validate_questions({'questions': [{'question': 'test'}]})
Ejemplo n.º 9
0
 def test_empty_list(self):
     with self.assertRaises(importer.ValidationError):
         importer.validate_questions({'questions': []})
Ejemplo n.º 10
0
 def test_not_list(self):
     with self.assertRaises(importer.ValidationError):
         importer.validate_questions({'questions': 'value'})