-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #3202 from uw-it-aca/qa
Feat/muwm 5381 (#3196)
- Loading branch information
Showing
54 changed files
with
390 additions
and
35 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
# Copyright 2025 UW-IT, University of Washington | ||
# SPDX-License-Identifier: Apache-2.0 | ||
|
||
""" | ||
This class interactes with the idcard eligibility web service. | ||
""" | ||
|
||
from uw_admin_systems.idcard import get_idcard_elig | ||
from myuw.dao import get_netid_of_current_user | ||
|
||
|
||
def get_idcard_eli(request): | ||
return get_idcard_elig(get_netid_of_current_user(request)).json_data() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
1 change: 1 addition & 0 deletions
1
myuw/resources/upass/file/idcarddataws/api/person/v1/eligibility/bill
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
{"uwId":"bill","empCardElig":"Y","stdtCardElig":"N"} |
1 change: 1 addition & 0 deletions
1
myuw/resources/upass/file/idcarddataws/api/person/v1/eligibility/billbot
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
{"uwId":"billbot","empCardElig":"Y","stdtCardElig":"N"} |
1 change: 1 addition & 0 deletions
1
myuw/resources/upass/file/idcarddataws/api/person/v1/eligibility/billgrad
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
{"uwId":"billgrad","empCardElig":"Y","stdtCardElig":"Y"} |
1 change: 1 addition & 0 deletions
1
myuw/resources/upass/file/idcarddataws/api/person/v1/eligibility/billpce
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
{"uwId":"billpce","empCardElig":"Y","stdtCardElig":"N"} |
1 change: 1 addition & 0 deletions
1
myuw/resources/upass/file/idcarddataws/api/person/v1/eligibility/billsea
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
{"uwId":"billsea","empCardElig":"Y","stdtCardElig":"N"} |
1 change: 1 addition & 0 deletions
1
myuw/resources/upass/file/idcarddataws/api/person/v1/eligibility/billtac
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
{"uwId":"billtac","empCardElig":"Y","stdtCardElig":"N"} |
1 change: 1 addition & 0 deletions
1
myuw/resources/upass/file/idcarddataws/api/person/v1/eligibility/botgrad
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
{"uwId":"botgrad","empCardElig":"N","stdtCardElig":"Y"} |
1 change: 1 addition & 0 deletions
1
myuw/resources/upass/file/idcarddataws/api/person/v1/eligibility/eight
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
{"uwId":"eight","empCardElig":"N","stdtCardElig":"Y"} |
1 change: 1 addition & 0 deletions
1
myuw/resources/upass/file/idcarddataws/api/person/v1/eligibility/javg001
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
{"uwId":"javg001","empCardElig":"N","stdtCardElig":"Y"} |
1 change: 1 addition & 0 deletions
1
myuw/resources/upass/file/idcarddataws/api/person/v1/eligibility/javg002
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
{"uwId":"javg002","empCardElig":"N","stdtCardElig":"Y"} |
1 change: 1 addition & 0 deletions
1
myuw/resources/upass/file/idcarddataws/api/person/v1/eligibility/javg003
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
{"uwId":"javg003","empCardElig":"N","stdtCardElig":"Y"} |
1 change: 1 addition & 0 deletions
1
myuw/resources/upass/file/idcarddataws/api/person/v1/eligibility/javg004
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
{"uwId":"javg004","empCardElig":"N","stdtCardElig":"Y"} |
1 change: 1 addition & 0 deletions
1
myuw/resources/upass/file/idcarddataws/api/person/v1/eligibility/jbothell
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
{"uwId":"eight","empCardElig":"N","stdtCardElig":"Y"} |
1 change: 1 addition & 0 deletions
1
myuw/resources/upass/file/idcarddataws/api/person/v1/eligibility/jeos
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
{"uwId":"jeos","empCardElig":"R","stdtCardElig":"Y"} |
1 change: 1 addition & 0 deletions
1
myuw/resources/upass/file/idcarddataws/api/person/v1/eligibility/jinter
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
{"uwId":"jinter","empCardElig":"N","stdtCardElig":"N"} |
1 change: 1 addition & 0 deletions
1
myuw/resources/upass/file/idcarddataws/api/person/v1/eligibility/jnew
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
{"uwId":"jnew","empCardElig":"N","stdtCardElig":"N"} |
1 change: 1 addition & 0 deletions
1
myuw/resources/upass/file/idcarddataws/api/person/v1/eligibility/jpce
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
{"uwId":"jpce","empCardElig":"N","stdtCardElig":"N"} |
1 change: 1 addition & 0 deletions
1
myuw/resources/upass/file/idcarddataws/api/person/v1/eligibility/retirestaff
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
{"uwId":"retirestaff","empCardElig":"R","stdtCardElig":"N"} |
1 change: 1 addition & 0 deletions
1
myuw/resources/upass/file/idcarddataws/api/person/v1/eligibility/seagrad
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
{"uwId":"seagrad","empCardElig":"N","stdtCardElig":"Y"} |
1 change: 1 addition & 0 deletions
1
myuw/resources/upass/file/idcarddataws/api/person/v1/eligibility/tacgrad
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
{"uwId":"tacgrad","empCardElig":"N","stdtCardElig":"N"} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,23 @@ | ||
<h1>UPASS</h1> | ||
{% include "restclients/customform/_common/netid.html" %} | ||
<h1>Husky Card</h1> | ||
<form method="post" action="{{form_action}}"> | ||
{% csrf_token %} | ||
<p> | ||
<label for="uwnetid">UW NetID:</label> | ||
<input id="uwnetid" name="uwnetid" size="20" type="text"> | ||
</p> | ||
<p>Find any of the following:</p> | ||
<fieldset> | ||
<div> | ||
<input type="radio" id="res" name="res" value="idcard" /> | ||
<label for="res">Husky Card ID Eligibility</label> | ||
</div> | ||
<div> | ||
<input type="radio" id="res" name="res" value="upass" /> | ||
<label for="res">UPASS Membership</label> | ||
</div> | ||
</fieldset> | ||
<br /> | ||
<p> | ||
<input value="Submit" type="submit"> | ||
</p> | ||
</form> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
# Copyright 2025 UW-IT, University of Washington | ||
# SPDX-License-Identifier: Apache-2.0 | ||
|
||
from datetime import datetime | ||
import json | ||
from myuw.test.api import ( | ||
MyuwApiTest, require_url, fdao_uw_admin_sys_override) | ||
|
||
|
||
@fdao_uw_admin_sys_override | ||
@require_url("myuw_idcard_elig_api") | ||
class TestIDcardApi(MyuwApiTest): | ||
|
||
def test_normal(self): | ||
self.set_user('javerage') | ||
response = self.get_response_by_reverse('myuw_idcard_elig_api') | ||
self.assertEqual(response.status_code, 200) | ||
self.assertEqual( | ||
json.loads(response.content.decode("UTF-8")), | ||
{ | ||
"not_eligible": False, | ||
"employee_eligible": True, | ||
"student_eligible": True, | ||
"retiree_eligible": False, | ||
}, | ||
) | ||
|
||
def test_error_404(self): | ||
self.set_user('noexist') | ||
response = self.get_response_by_reverse('myuw_idcard_elig_api') | ||
self.assertEqual(response.status_code, 404) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
# Copyright 2025 UW-IT, University of Washington | ||
# SPDX-License-Identifier: Apache-2.0 | ||
|
||
from django.test import TestCase | ||
from restclients_core.exceptions import DataFailureException | ||
from myuw.dao.idcard_elig import get_idcard_eli | ||
from myuw.test import ( | ||
fdao_uw_admin_sys_override, get_request_with_user) | ||
|
||
|
||
@fdao_uw_admin_sys_override | ||
class TestIDcardDao(TestCase): | ||
|
||
def test_get_idcard_eli(self): | ||
req = get_request_with_user("javerage") | ||
status = get_idcard_eli(req) | ||
self.assertEqual(status, { | ||
"not_eligible": False, | ||
"employee_eligible": True, | ||
"student_eligible": True, | ||
"retiree_eligible": False}) | ||
|
||
req = get_request_with_user("jpce") | ||
status = get_idcard_eli(req) | ||
self.assertEqual(status, { | ||
"not_eligible": True, | ||
"employee_eligible": False, | ||
"student_eligible": False, | ||
"retiree_eligible": False}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.