forked from quay/quay
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
worker: include orgs in reconciler runs (PROJQUAY-8431) (quay#3560)
Adds an include_orgs param to the active users query used by the reconciler and sets it to true for reconciler runs Reconciler is not including orgs as a candidate for creating corresponding RH entitlements. As a result it misses users with stripe billing that are considered orgs.
- Loading branch information
Showing
3 changed files
with
17 additions
and
2 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 |
---|---|---|
|
@@ -22,6 +22,18 @@ def test_skip_free_user(initialized_db): | |
mock.assert_not_called() | ||
|
||
|
||
def test_reconcile_org_user(initialized_db): | ||
user = model.user.get_user("devtable") | ||
|
||
org_user = model.organization.create_organization("org_user", "[email protected]", user) | ||
org_user.stripe_id = "cus_" + "".join(random.choices(string.ascii_lowercase, k=14)) | ||
org_user.save() | ||
with patch.object(marketplace_users, "lookup_customer_id") as mock: | ||
worker._perform_reconciliation(marketplace_users, marketplace_subscriptions) | ||
|
||
mock.assert_called_with(org_user.email) | ||
|
||
|
||
def test_exception_handling(initialized_db): | ||
with patch("data.billing.FakeStripe.Customer.retrieve") as mock: | ||
mock.side_effect = stripe.error.InvalidRequestException | ||
|