soft deletes available for applications and environments
- parent relation will not include applications or environments marked as deleted - domain classes will exclude deleted objects from selections - changed some test factories to use domain_word for resource names, because they were using person names and it bugged me
This commit is contained in:
@@ -1,4 +1,8 @@
|
||||
from tests.factories import ApplicationFactory, ApplicationRoleFactory
|
||||
from tests.factories import (
|
||||
ApplicationFactory,
|
||||
ApplicationRoleFactory,
|
||||
EnvironmentFactory,
|
||||
)
|
||||
|
||||
|
||||
def test_application_num_users():
|
||||
@@ -9,3 +13,11 @@ def test_application_num_users():
|
||||
|
||||
ApplicationRoleFactory.create(application=application)
|
||||
assert application.num_users == 1
|
||||
|
||||
|
||||
def test_application_environments_excludes_deleted():
|
||||
app = ApplicationFactory.create()
|
||||
env = EnvironmentFactory.create(application=app)
|
||||
EnvironmentFactory.create(application=app, deleted=True)
|
||||
assert len(app.environments) == 1
|
||||
assert app.environments[0].id == env.id
|
||||
|
Reference in New Issue
Block a user