-
Notifications
You must be signed in to change notification settings - Fork 2
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 #871 from eciis/fix-get-all-institutions
Fix query handler to find only active institutions
- Loading branch information
Showing
2 changed files
with
11 additions
and
4 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -31,8 +31,14 @@ def test_get(self, verify_token): | |
user = mocks.create_user('[email protected]') | ||
# new Institution FIRST INST | ||
first_inst = mocks.create_institution('FIRST INST') | ||
# new Institution SECOND INST | ||
first_inst.state = "active" | ||
first_inst.put() | ||
# new Institution SECOND INST with pending state default | ||
second_inst = mocks.create_institution('SECOND INST') | ||
# new Institution THIRD INST | ||
third_inst = mocks.create_institution('THIRD INST') | ||
third_inst.state = "active" | ||
third_inst.put() | ||
|
||
# Call the get method | ||
all_institutions = self.testapp.get("/api/institutions?page=0&&limit=2").json | ||
|
@@ -43,5 +49,5 @@ def test_get(self, verify_token): | |
self.assertEqual(all_institutions['institutions'][0]['name'], first_inst.name, | ||
"The name of institituion should be equal to the first_inst name") | ||
|
||
self.assertEqual(all_institutions['institutions'][1]['name'], second_inst.name, | ||
"The name of institution should be equal to the second_inst name") | ||
self.assertEqual(all_institutions['institutions'][1]['name'], third_inst.name, | ||
"The name of institution should be equal to the third_inst name") |