Skip to content

Commit

Permalink
Merge pull request #335 from UW-GAC/bugfix/add-cdsa-migration
Browse files Browse the repository at this point in the history
Add forgotten CDSA migration
  • Loading branch information
amstilp authored Dec 4, 2023
2 parents 7e1f7a1 + ff8b1db commit ed52adf
Show file tree
Hide file tree
Showing 2 changed files with 59 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
# Generated by Django 4.2.7 on 2023-12-04 23:27

from django.db import migrations
import model_utils.fields


class Migration(migrations.Migration):

dependencies = [
("cdsa", "0009_signedagreement_add_field_status"),
]

operations = [
migrations.AlterField(
model_name="historicalsignedagreement",
name="status",
field=model_utils.fields.StatusField(
choices=[
("active", "Active"),
("withdrawn", "Withdrawn"),
("lapsed", "Lapsed"),
],
default="active",
max_length=100,
no_check_for_status=True,
verbose_name="status",
),
),
migrations.AlterField(
model_name="signedagreement",
name="status",
field=model_utils.fields.StatusField(
choices=[
("active", "Active"),
("withdrawn", "Withdrawn"),
("lapsed", "Lapsed"),
],
default="active",
max_length=100,
no_check_for_status=True,
verbose_name="status",
),
),
]
15 changes: 15 additions & 0 deletions primed/cdsa/tests/test_models.py
Original file line number Diff line number Diff line change
Expand Up @@ -209,6 +209,21 @@ def test_get_absolute_url(self):
instance.signed_agreement.get_absolute_url(), instance.get_absolute_url()
)

def test_statuses(self):
"""All allowed statuses."""
instance = factories.SignedAgreementFactory.create(
status=models.SignedAgreement.StatusChoices.ACTIVE
)
instance.full_clean()
instance = factories.SignedAgreementFactory.create(
status=models.SignedAgreement.StatusChoices.WITHDRAWN
)
instance.full_clean()
instance = factories.SignedAgreementFactory.create(
status=models.SignedAgreement.StatusChoices.LAPSED
)
instance.full_clean()

def test_member_choices(self):
"""Can create instances with all of the member choices."""
instance = factories.SignedAgreementFactory.create(
Expand Down

0 comments on commit ed52adf

Please sign in to comment.