fix rcr tests
This commit is contained in:
@@ -44,7 +44,7 @@ def create_oncology_user(db, django_user_model, create_groups):
|
|||||||
|
|
||||||
@pytest.fixture
|
@pytest.fixture
|
||||||
def create_item(db, create_radiology_category, create_oncology_category, create_outcome, create_outcome_reason, create_level):
|
def create_item(db, create_radiology_category, create_oncology_category, create_outcome, create_outcome_reason, create_level):
|
||||||
return Item.objects.create(
|
item = Item.objects.create(
|
||||||
name="Test Item",
|
name="Test Item",
|
||||||
description="Test Description",
|
description="Test Description",
|
||||||
content_type="Test Content Type",
|
content_type="Test Content Type",
|
||||||
@@ -55,7 +55,7 @@ def create_item(db, create_radiology_category, create_oncology_category, create_
|
|||||||
review_link="Test Review Link",
|
review_link="Test Review Link",
|
||||||
review_link_password="Test Password",
|
review_link_password="Test Password",
|
||||||
rcr_platform_id="Test Platform ID",
|
rcr_platform_id="Test Platform ID",
|
||||||
radiology_category=create_radiology_category,
|
#radiology_category=create_radiology_category,
|
||||||
oncology_category=create_oncology_category,
|
oncology_category=create_oncology_category,
|
||||||
outcome=create_outcome,
|
outcome=create_outcome,
|
||||||
outcome_reason=create_outcome_reason,
|
outcome_reason=create_outcome_reason,
|
||||||
@@ -66,6 +66,10 @@ def create_item(db, create_radiology_category, create_oncology_category, create_
|
|||||||
completed_oncology=True
|
completed_oncology=True
|
||||||
)
|
)
|
||||||
|
|
||||||
|
item.level.add(create_level)
|
||||||
|
item.radiology_categories.add(create_radiology_category)
|
||||||
|
return item
|
||||||
|
|
||||||
@pytest.fixture
|
@pytest.fixture
|
||||||
def create_level(db):
|
def create_level(db):
|
||||||
return Level.objects.create(name="Test Level")
|
return Level.objects.create(name="Test Level")
|
||||||
|
|||||||
@@ -4,51 +4,8 @@ from django.contrib.auth import get_user_model
|
|||||||
from rcr.models import Item, Level, RadiologyCategory, OncologyCategory, Outcome, OutcomeReason
|
from rcr.models import Item, Level, RadiologyCategory, OncologyCategory, Outcome, OutcomeReason
|
||||||
import pytest
|
import pytest
|
||||||
|
|
||||||
@pytest.fixture
|
|
||||||
def create_level(db):
|
|
||||||
return Level.objects.create(name="Test Level")
|
|
||||||
|
|
||||||
@pytest.fixture
|
|
||||||
def create_radiology_category(db):
|
|
||||||
return RadiologyCategory.objects.create(name="Test Radiology Category")
|
|
||||||
|
|
||||||
@pytest.fixture
|
|
||||||
def create_oncology_category(db):
|
|
||||||
return OncologyCategory.objects.create(name="Test Oncology Category")
|
|
||||||
|
|
||||||
@pytest.fixture
|
|
||||||
def create_outcome(db):
|
|
||||||
return Outcome.objects.create(name="Test Outcome")
|
|
||||||
|
|
||||||
@pytest.fixture
|
|
||||||
def create_outcome_reason(db):
|
|
||||||
return OutcomeReason.objects.create(reason="Test Outcome Reason")
|
|
||||||
|
|
||||||
@pytest.fixture
|
|
||||||
def create_item(db, create_level, create_radiology_category, create_oncology_category, create_outcome, create_outcome_reason):
|
|
||||||
item = Item.objects.create(
|
|
||||||
name="Test Item",
|
|
||||||
description="Test Description",
|
|
||||||
content_type="Test Content Type",
|
|
||||||
number_of_items=1,
|
|
||||||
specialty="Test Specialty",
|
|
||||||
access_count=1,
|
|
||||||
targeted_to_group="Test Group",
|
|
||||||
review_link="Test Review Link",
|
|
||||||
review_link_password="Test Password",
|
|
||||||
rcr_platform_id="Test Platform ID",
|
|
||||||
radiology_category=create_radiology_category,
|
|
||||||
oncology_category=create_oncology_category,
|
|
||||||
outcome=create_outcome,
|
|
||||||
outcome_reason=create_outcome_reason,
|
|
||||||
outcome_free_text="Test Outcome Free Text",
|
|
||||||
comments="Test Comments",
|
|
||||||
needs_review=True,
|
|
||||||
completed_radiology=True,
|
|
||||||
completed_oncology=True
|
|
||||||
)
|
|
||||||
item.level.add(create_level)
|
|
||||||
return item
|
|
||||||
|
|
||||||
def test_item_creation(create_item):
|
def test_item_creation(create_item):
|
||||||
assert Item.objects.count() == 1
|
assert Item.objects.count() == 1
|
||||||
|
|||||||
Reference in New Issue
Block a user