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:
dandds
2019-04-09 06:35:50 -04:00
parent c2a76c2504
commit 1c0c5dd9c5
11 changed files with 111 additions and 12 deletions

View File

@@ -105,7 +105,7 @@ class PortfolioFactory(Base):
class Meta:
model = Portfolio
name = factory.Faker("name")
name = factory.Faker("domain_word")
defense_component = factory.LazyFunction(random_service_branch)
@classmethod
@@ -157,7 +157,7 @@ class ApplicationFactory(Base):
model = Application
portfolio = factory.SubFactory(PortfolioFactory)
name = factory.Faker("name")
name = factory.Faker("domain_word")
description = "A test application"
@classmethod
@@ -192,6 +192,8 @@ class EnvironmentFactory(Base):
class Meta:
model = Environment
name = factory.Faker("domain_word")
@classmethod
def _create(cls, model_class, *args, **kwargs):
with_members = kwargs.pop("members", [])