From a7e57d34a49781a2618435af66ab1f35e1f1f20b Mon Sep 17 00:00:00 2001 From: Ethan Nguyen Date: Sun, 25 Jul 2021 23:09:45 -0400 Subject: [PATCH] test(profile): add tests for 21555de8163ba4e26841491155950d89d513530a --- tjdests/apps/profile/tests.py | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) diff --git a/tjdests/apps/profile/tests.py b/tjdests/apps/profile/tests.py index 886bd5c..26b8ac4 100644 --- a/tjdests/apps/profile/tests.py +++ b/tjdests/apps/profile/tests.py @@ -455,6 +455,37 @@ class ProfileTest(TJDestsTestCase): ).count(), ) + # Test adding an early-decision decision and receiving admittance + Decision.objects.all().delete() + response = self.client.post( + reverse("profile:decision_add"), + data={ + "college": college.id, + "decision_type": "ED", + "admission_status": "ADMIT", + }, + ) + self.assertEqual(302, response.status_code) + self.assertEqual( + 1, + Decision.objects.filter( + college=college, + user=user, + admission_status=Decision.ADMIT, + decision_type=Decision.EARLY_DECISION, + ).count(), + ) + # The user's attending college should be set to the one just added + self.assertEqual( + User.objects.get(id=user.id).attending_decision, + Decision.objects.get( + college=college, + user=user, + admission_status=Decision.ADMIT, + decision_type=Decision.EARLY_DECISION, + ), + ) + def test_decision_update(self): user = self.login(make_senior=True, make_student=True, accept_tos=True)