Merge pull request #350 from dod-ccpo/coverage-#160694116
Coverage #160694116
This commit is contained in:
@@ -16,3 +16,23 @@ def test_workspace_totals():
|
||||
report = Reports.workspace_totals(workspace)
|
||||
total = 200 * len(CLIN_NUMS)
|
||||
assert report == {"budget": total, "spent": 0}
|
||||
|
||||
|
||||
# this is sketched in until we do real reporting
|
||||
def test_monthly_totals():
|
||||
request = RequestFactory.create()
|
||||
workspace = WorkspaceFactory.create(request=request)
|
||||
monthly = Reports.monthly_totals(workspace)
|
||||
|
||||
assert not monthly["environments"]
|
||||
assert not monthly["projects"]
|
||||
assert not monthly["workspace"]
|
||||
|
||||
|
||||
# this is sketched in until we do real reporting
|
||||
def test_cumulative_budget():
|
||||
request = RequestFactory.create()
|
||||
workspace = WorkspaceFactory.create(request=request)
|
||||
months = Reports.cumulative_budget(workspace)
|
||||
|
||||
assert len(months["months"]) == 12
|
||||
|
@@ -42,14 +42,14 @@ def test_new_request_has_started_status():
|
||||
|
||||
|
||||
def test_auto_approve_less_than_1m():
|
||||
new_request = RequestFactory.create(initial_revision={"dollar_value": 999999})
|
||||
new_request = RequestFactory.create(initial_revision={"dollar_value": 999_999})
|
||||
request = Requests.submit(new_request)
|
||||
|
||||
assert request.status == RequestStatus.PENDING_FINANCIAL_VERIFICATION
|
||||
|
||||
|
||||
def test_dont_auto_approve_if_dollar_value_is_1m_or_above():
|
||||
new_request = RequestFactory.create(initial_revision={"dollar_value": 1000000})
|
||||
new_request = RequestFactory.create(initial_revision={"dollar_value": 1_000_000})
|
||||
request = Requests.submit(new_request)
|
||||
|
||||
assert request.status == RequestStatus.PENDING_CCPO_ACCEPTANCE
|
||||
|
@@ -119,7 +119,7 @@ class RequestFactory(Base):
|
||||
)
|
||||
|
||||
@classmethod
|
||||
def create_initial_revision(cls, request, dollar_value=1000000):
|
||||
def create_initial_revision(cls, request, dollar_value=1_000_000):
|
||||
user = request.creator
|
||||
default_data = dict(
|
||||
name=factory.Faker("domain_word"),
|
||||
@@ -212,12 +212,12 @@ class TaskOrderFactory(Base):
|
||||
random.randrange(1, 28),
|
||||
)
|
||||
)
|
||||
clin_0001 = random.randrange(100, 100000)
|
||||
clin_0003 = random.randrange(100, 100000)
|
||||
clin_1001 = random.randrange(100, 100000)
|
||||
clin_1003 = random.randrange(100, 100000)
|
||||
clin_2001 = random.randrange(100, 100000)
|
||||
clin_2003 = random.randrange(100, 100000)
|
||||
clin_0001 = random.randrange(100, 100_000)
|
||||
clin_0003 = random.randrange(100, 100_000)
|
||||
clin_1001 = random.randrange(100, 100_000)
|
||||
clin_1003 = random.randrange(100, 100_000)
|
||||
clin_2001 = random.randrange(100, 100_000)
|
||||
clin_2003 = random.randrange(100, 100_000)
|
||||
|
||||
|
||||
class WorkspaceFactory(Base):
|
||||
|
@@ -12,7 +12,7 @@ def test_list_contracts():
|
||||
def test_get_contract():
|
||||
result = client.get_contract("DCA10096D0052", "y")
|
||||
assert result["contract_no"] == "DCA10096D0052"
|
||||
assert result["amount"] == 2000000
|
||||
assert result["amount"] == 2_000_000
|
||||
|
||||
|
||||
def test_contract_not_found():
|
||||
|
Reference in New Issue
Block a user