-
Notifications
You must be signed in to change notification settings - Fork 1
Add security.models.Individual.is_member() #18
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
Conversation
Replaced by getting primary organization for an Individual, then the "first" membership for that organization, where "first" means the first one that comes back when we query MemberSuite for the list of all memberships for an organization (in memberships.services).
| # | | ||
| # | | ||
| # V | ||
| test_org_id = "6faf90e4-0007-c9dc-98b7-0b3c53985743" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These are actually different: '6faf90e4-0074-cbb5-c1d2-0b3c539859ef' != "6faf90e4-0007-c9dc-98b7-0b3c53985743"
The first is for some org that had a membership, the second is "AASHE Test Campus" that does not. We would of course change these if we ever get a sandbox set up.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The comment below (Test org with a membership) makes it look like '6faf90e4-0007-c578-8310-0b3c53985743' is for an org with memberships, too. Not so?
# Test org with a membership
test_org_id = "6faf90e4-0007-c578-8310-0b3c53985743"
membership_list = self.service.get_memberships_for_org(test_org_id)
self.assertEqual(type(membership_list[0]), Membership)
self.assertEqual(membership_list[0].id,
'6faf90e4-0074-cbb5-c1d2-0b3c539859ef')
# Test org without a membership
test_org_id = "6faf90e4-0007-c9dc-98b7-0b3c53985743"There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Line 36 tries querying memberships for "6faf90e4-0007-c9dc-98b7-0b3c53985743", but should return an empty list.
I think MemberSuite's ID system is confusing, here. IDs for all objects have the same format.
"6faf90e4-0007-c578-8310-0b3c53985743" is an organization that does have an associated membership.
'6faf90e4-0074-cbb5-c1d2-0b3c539859ef' is that associated membership.
"6faf90e4-0007-c9dc-98b7-0b3c53985743" is another organization that does NOT have a memebrship, so the lines below it test that calling "get_memberships_for_org()" returns an empty result list.
|
Oh jeez, I’m sorry, I was just looking at the end of the IDs (`0b3c53985743`) assuming they were serial.
Thanks for your help, Scott. I’ll close the ticket.
…On Feb 13, 2017, 10:26 AM -0500, Scott Johnson ***@***.***>, wrote:
@baronvonvaderham commented on this pull request.
In membersuite_api_client/tests/test_memberships.py:
> @@ -21,6 +24,14 @@ def test_get_membership_for_org(self):
'6faf90e4-0074-cbb5-c1d2-0b3c539859ef')
# Test org without a membership
+
+ # Need an Organization ID for a non-member org. The one here
+ # is the same used above for testing with a member org.
+ #
+ # HERE!
+ # |
+ # |
+ # V
test_org_id = "6faf90e4-0007-c9dc-98b7-0b3c53985743"
Line 36 tries querying memberships for "6faf90e4-0007-c9dc-98b7-0b3c53985743", but should return an empty list.
I think MemberSuite's ID system is confusing, here. IDs for all objects have the same format.
"6faf90e4-0007-c578-8310-0b3c53985743" is an organization that does have an associated membership.
'6faf90e4-0074-cbb5-c1d2-0b3c539859ef' is that associated membership.
"6faf90e4-0007-c9dc-98b7-0b3c53985743" is another organization that does NOT have a memebrship, so the lines below it test that calling "get_memberships_for_org()" returns an empty result list.
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub, or mute the thread.
--
Join us in San Antonio, TX from Oct. 15 - 18 for the 2017 AASHE Conference &
Expo, themed Stronger in Solidarity. Call for proposals and reviewers now
open <http://conference.aashe.org/call-for-proposals>.
Connect with us: Website <http://www.aashe.org/> | Facebook
<https://www.facebook.com/aasheorg> | Twitter
<https://twitter.com/AASHENews> | LinkedIn
<http://www.linkedin.com/company/aashe>
------------------------------
Email Confidentiality Notice
<http://www.aashe.org/email_confidentiality_notice>
|
|
Oh that test is actually failing now. It looks like someone added a membership to that for some reason, probably Jessica or someone doing training on the system. All the more reason we need a sandbox I guess. I'm updating the ID in a commit I'll be pushing to master soon (it's just a couple minor tweaks I need for ISS work). |
No description provided.