|
7 | 7 | from django.core.management import call_command
|
8 | 8 | from django.test import TestCase
|
9 | 9 |
|
10 |
| -from coldfront.core.allocation.models import Allocation, AllocationAttributeType |
| 10 | +from coldfront.core.allocation.models import Allocation |
11 | 11 | from coldfront.core.resource.models import ResourceAttribute, ResourceAttributeType, ResourceType
|
12 | 12 | from coldfront.core.test_helpers.factories import (
|
13 | 13 | AllocationAttributeFactory,
|
| 14 | + AllocationAttributeTypeFactory, |
14 | 15 | AllocationStatusChoiceFactory,
|
15 | 16 | AllocationUserFactory,
|
16 | 17 | ProjectFactory,
|
|
22 | 23 |
|
23 | 24 | # Building this account structure in slurm/coldfront
|
24 | 25 | # 'a' represents an account and 'u' represents a user
|
| 26 | +# unless otherwise stated |
25 | 27 | #
|
26 | 28 | # a1 a7
|
27 | 29 | # / \ / | \
|
|
37 | 39 | class AssociationTest(TestCase):
|
38 | 40 | @classmethod
|
39 | 41 | def setUpClass(cls):
|
40 |
| - # call_command("import_field_of_science_data") |
41 |
| - # call_command("add_default_grant_options") |
42 | 42 | call_command("add_default_project_choices")
|
43 | 43 | call_command("add_allocation_defaults")
|
44 | 44 | call_command("add_resource_defaults")
|
@@ -67,8 +67,8 @@ def setUpTestData(cls):
|
67 | 67 | ProjectUserFactory(project=cls.project, user=cls.u4)
|
68 | 68 | # create allocations
|
69 | 69 | alloc_kwargs = {"project": cls.project, "status": AllocationStatusChoiceFactory(name="Active")}
|
70 |
| - san_aat = AllocationAttributeType.objects.get(name="slurm_account_name") |
71 |
| - sc_aat = AllocationAttributeType.objects.get(name="slurm_children") |
| 70 | + san_aat = AllocationAttributeTypeFactory(name="slurm_account_name") |
| 71 | + sc_aat = AllocationAttributeTypeFactory(name="slurm_children") |
72 | 72 | cls.a1 = Allocation.objects.create(**alloc_kwargs)
|
73 | 73 | cls.a2 = Allocation.objects.create(**alloc_kwargs)
|
74 | 74 | cls.a3 = Allocation.objects.create(**alloc_kwargs)
|
|
0 commit comments