Fix factories and seed sample script

Update display of defense component on portfolio settings page
This commit is contained in:
leigh-mil
2020-01-02 12:45:11 -05:00
parent dad54ec139
commit 8710028256
4 changed files with 16 additions and 8 deletions

View File

@@ -21,6 +21,10 @@ def random_service_branch():
return random_choice(data.SERVICE_BRANCHES)
def random_defense_component():
return [random_choice(data.SERVICE_BRANCHES)]
def random_dod_id():
return "".join(random.choices(string.digits, k=10))
@@ -104,7 +108,7 @@ class PortfolioFactory(Base):
model = Portfolio
name = factory.Faker("domain_word")
defense_component = factory.LazyFunction(random_service_branch)
defense_component = factory.LazyFunction(random_defense_component)
description = factory.Faker("sentence")
@classmethod

View File

@@ -34,7 +34,7 @@ def test_create_portfolio_success(client, user_session):
data={
"name": "My project name",
"description": "My project description",
"defense_component": "army",
"defense_component": ["army"],
},
)