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