Esempio n. 1
0
 def test_entity_calls_main_validate_methods(self):
     post = PostFactory()
     post._validate_required = Mock()
     post._validate_attributes = Mock()
     post._validate_empty_attributes = Mock()
     post._validate_children = Mock()
     post.validate()
     assert post._validate_required.call_count == 1
     assert post._validate_attributes.call_count == 1
     assert post._validate_empty_attributes.call_count == 1
     assert post._validate_children.call_count == 1
Esempio n. 2
0
 def test_entity_calls_main_validate_methods(self):
     post = PostFactory()
     post._validate_required = Mock()
     post._validate_attributes = Mock()
     post._validate_empty_attributes = Mock()
     post._validate_children = Mock()
     post.validate()
     assert post._validate_required.call_count == 1
     assert post._validate_attributes.call_count == 1
     assert post._validate_empty_attributes.call_count == 1
     assert post._validate_children.call_count == 1
Esempio n. 3
0
 def test_entity_calls_attribute_validate_method(self):
     post = PostFactory()
     post.validate_location = Mock()
     post.validate()
     assert post.validate_location.call_count == 1
Esempio n. 4
0
 def test_entity_calls_attribute_validate_method(self):
     post = PostFactory()
     post.validate_location = Mock()
     post.validate()
     assert post.validate_location.call_count == 1