Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bare offer #260

Merged
merged 3 commits into from
Aug 8, 2016
Merged

Bare offer #260

merged 3 commits into from
Aug 8, 2016

Conversation

higs4281
Copy link
Member

@higs4281 higs4281 commented Aug 5, 2016

This delivers a blank disclosure when a request goes to the bare /offer/ URL

Changes

  • Offer view watches for requests with no querystring

Note

It appears that without an offer ID, you can't answer the final question.

Testing

Review

Checklist

  • Project documentation has been updated (including the "Unreleased" section of the CHANGELOG)

This makes a request to the bare /offer/ url return a blank disclosure
with no error messages.
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 7033d3f..bcbd35a 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -16,6 +16,7 @@ We follow the [Semantic Versioning 2.0.0](http://semver.org/) format.
 - Fix alignment issues in debt summary
 - Update our national statistics from scorecard project
 - Update national stats to deliver generic stats at /api/national-stats/
+- simplify warnings for ID problems

 ## 2.1.5
 - Show recalculation updates on mobile screens
diff --git a/paying_for_college/tests/test_views.py b/paying_for_college/tests/test_views.py
index 7fbadf5..8119061 100644
--- a/paying_for_college/tests/test_views.py
+++ b/paying_for_college/tests/test_views.py
@@ -253,27 +253,27 @@ class OfferTest(django.test.TestCase):
         self.assertTrue(resp.status_code == 200)
         resp2 = client.get(url+no_oid)
         self.assertTrue(resp2.status_code == 200)
-        self.assertTrue("Warning" in resp2.context['warning'])
+        self.assertTrue("noOffer" in resp2.context['warning'])
         resp3 = client.get(url+bad_school)
-        self.assertTrue("Warning" in resp3.context['warning'])
+        self.assertTrue("noSchool" in resp3.context['warning'])
         self.assertTrue(resp3.status_code == 200)
         resp4 = client.get(url+bad_program)
         self.assertTrue(resp4.status_code == 200)
-        self.assertTrue("Warning" in resp4.context['warning'])
+        self.assertTrue("noProgram" in resp4.context['warning'])
         resp5 = client.get(url+missing_oid_field)
         self.assertTrue(resp5.status_code == 200)
-        self.assertTrue("Warning" in resp5.context['warning'])
+        self.assertTrue("noOffer" in resp5.context['warning'])
         resp6 = client.get(url+missing_school_id)
-        self.assertTrue("Warning" in resp6.context['warning'])
+        self.assertTrue("noSchool" in resp6.context['warning'])
         self.assertTrue(resp6.status_code == 200)
         resp7 = client.get(url+bad_oid)
-        self.assertTrue("Error" in resp7.context['warning'])
+        self.assertTrue("noOffer" in resp7.context['warning'])
         self.assertTrue(resp7.status_code == 200)
         resp8 = client.get(url+illegal_program)
-        self.assertTrue("Error" in resp8.context['warning'])
+        self.assertTrue("noProgram" in resp8.context['warning'])
         self.assertTrue(resp8.status_code == 200)
         resp9 = client.get(url+no_program)
-        self.assertTrue("Warning" in resp9.context['warning'])
+        self.assertTrue("noProgram" in resp9.context['warning'])
         self.assertTrue(resp9.status_code == 200)

diff --git a/paying_for_college/views.py b/paying_for_college/views.py
index 157aec6..98157e9 100755
--- a/paying_for_college/views.py
+++ b/paying_for_college/views.py
@@ -46,11 +46,9 @@ else:  # pragma: no cover

 URL_ROOT = 'paying-for-college2'
 EXPENSE_FILE = '{}/fixtures/bls_data.json'.format(BASEDIR)
-NO_SCHOOL_ERROR = "No active school could be found for iped ID {0}"
-OID_WARNING = "Error: Illegal offer ID"
-# only characters 0-9 and a-f are allowed in offer IDs
-PID_WARNING = "Error: Illegal program code"
-# program code isn't 40 chars or contains Illegal characters: ; < > { }
+IPED_ERROR = "noSchool"
+OID_ERROR = "noOffer"
+PID_ERROR = "noProgram"

 def get_json_file(filename):
Merge branch 'master' into bare-offer
@coveralls
Copy link

Coverage Status

Coverage remained the same at 100.0% when pulling d56ae2d on bare-offer into 371bcd0 on master.

@coveralls
Copy link

Coverage Status

Coverage remained the same at 100.0% when pulling 0f85117 on bare-offer into 0909d09 on master.

@marteki
Copy link
Member

marteki commented Aug 8, 2016

👍

@higs4281 higs4281 merged commit 6df814f into master Aug 8, 2016
@higs4281 higs4281 deleted the bare-offer branch August 8, 2016 16:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants