示例#1
0
    def test_empty(self):
        with self.assertRaises(importer.ValidationError):
            importer.validate_questions({})

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

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