Example #1
0
from yunity.utils.tests.mock import MockCategory

parent_category = MockCategory.create()
Example #2
0
from yunity.utils.tests.mock import MockCategory

parent_category = MockCategory.create()
existing_category = MockCategory.create()
 def test_validate_category_parent_passes(self):
     self.given_data(MockCategory.create().id)
     self.when_calling(types.category_parent)
     self.then_invocation_passed_with(AnyResult())
Example #4
0
from yunity.utils.tests.mock import MockCategory

categories = MockCategory.create_batch(10)
 def test_validate_category_name_fails_with_existing_category(self):
     self.given_data(MockCategory.create().name)
     self.when_calling(types.category_name)
     self.then_invocation_failed_with(ValidationFailure)