Skip to content

Commit b4a7152

Browse files
committed
fixup
1 parent fcf8621 commit b4a7152

File tree

4 files changed

+8
-14
lines changed

4 files changed

+8
-14
lines changed

coldfront/core/allocation/tests/test_models.py

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -150,13 +150,11 @@ def test_status_is_active_and_start_date_equals_end_date_no_error(self):
150150

151151

152152
class AllocationAttributeModelCleanMethodTests(TestCase):
153-
def _test_clean(
154-
self, allocation_attribute_type_name: str, allocation_attribute_values: list, expect_validation_error: bool
155-
):
156-
attribute_type = AAttributeTypeFactory(name=allocation_attribute_type_name)
153+
def _test_clean(self, alloc_attr_type_name: str, alloc_attr_values: list, expect_validation_error: bool):
154+
attribute_type = AAttributeTypeFactory(name=alloc_attr_type_name)
157155
allocation_attribute_type = AllocationAttributeTypeFactory(attribute_type=attribute_type)
158156
allocation_attribute = AllocationAttributeFactory(allocation_attribute_type=allocation_attribute_type)
159-
for value in allocation_attribute_values:
157+
for value in alloc_attr_values:
160158
with self.subTest(value=value):
161159
if not isinstance(value, str):
162160
raise TypeError("allocation attribute value must be a string")

coldfront/core/allocation/tests/test_views.py

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -59,13 +59,9 @@ def setUpTestData(cls):
5959
ProjectUserFactory(user=pi_user, project=cls.project, role=manager_role)
6060
cls.pi_user = pi_user
6161
# make a quota TB allocation attribute
62-
AllocationAttributeFactory(
63-
allocation=cls.allocation,
64-
value=100,
65-
allocation_attribute_type=AllocationAttributeTypeFactory(
66-
name="Storage Quota (TB)", attribute_type=AAttributeTypeFactory(name="Int")
67-
),
68-
)
62+
attr_type = AAttributeTypeFactory(name="Int")
63+
alloc_attr_type = AllocationAttributeTypeFactory(name="Storage Quota (TB)", attribute_type=attr_type)
64+
AllocationAttributeFactory(allocation=cls.allocation, value=100, allocation_attribute_type=alloc_attr_type)
6965

7066
def allocation_access_tstbase(self, url):
7167
"""Test basic access control for views. For all views:

coldfront/core/project/tests/test_views.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ def setUpTestData(cls):
3939
cls.admin_user = UserFactory(is_staff=True, is_superuser=True)
4040
cls.nonproject_user = UserFactory(is_staff=False, is_superuser=False)
4141

42-
attributetype = PAttributeTypeFactory(name="string")
42+
attributetype = PAttributeTypeFactory(name="Text")
4343
cls.projectattributetype = ProjectAttributeTypeFactory(attribute_type=attributetype)
4444

4545
def project_access_tstbase(self, url):

coldfront/core/test_helpers/factories.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -317,7 +317,7 @@ class Meta:
317317
model = AllocationAttribute
318318

319319
allocation_attribute_type = SubFactory(AllocationAttributeTypeFactory)
320-
value = "Test attribute value"
320+
value = 2048
321321
allocation = SubFactory(AllocationFactory)
322322

323323

0 commit comments

Comments
 (0)