def test_validate_raises_error_if_no_argument_model(self): record = Record(self.data, model='test') with self.assertRaises(RecordValidationError): record._validate(id=1)
def test_validate_raises_error_if_invalid_arguments(self): record = Record(self.data, model='test') with self.assertRaises(RecordValidationError): record._validate(model='test_model', invalid_arg=1)
def test_has_model_returns_None_if_kwargs_has_argument_model(self): record = Record(self.data, model='test') result = record._has_model(model='test_model', id=1) self.assertEqual(result, None)
def test_validate_is_None_if_all_arguments_are_valid(self): record = Record(self.data, model='test') result = record._validate(model='test_model', id=1) self.assertTrue(result is None)
def test_field_returns_object_of_type_Field(self): record = Record(self.data, model='test') field = record.field(name='test_name') self.assertEqual(type(field), Field)