Skip to content

Commit

Permalink
Merge ba506a4 into 865e79d
Browse files Browse the repository at this point in the history
  • Loading branch information
BarbosaJackson committed Nov 3, 2021
2 parents 865e79d + ba506a4 commit 80bafe6
Show file tree
Hide file tree
Showing 6 changed files with 37 additions and 14 deletions.
4 changes: 4 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,10 @@ env:
- OIDC_OP_JWKS_ENDPOINT=
- OIDC_RP_SIGN_ALGO=
- OIDC_OP_LOGOUT_ENDPOINT=
- BILLING_COST_PER_WHATSAPP=0.0
- BILLING_TEST_MODE=True
- secure: "KCQWp6w1c5KfzSnN0/nGfHMHFqEk9AJBSjBXI3rBoHDtTTBkX5UoEPVi6ikALtySkeNmRShjPuQFQIfYq4nVfP7+I1VpL7wnVaBGOJkWzYtiajDThUI4SQPTwHl0FTQjSHnT7FoiL1ludF25fA8eBDgnhjvrpIMTGTcrVXDXMhwZDbmgv7BslJm2t4YrX2rQR8AajDEnbJ6PLlyiXFCgJP/vyD8Ip9YZvtsZeWtFA+3LXYfRj89ja7CU7tLlLLwOKloHXqgvKt66HCjl4FQSaqX+jKgW9YnptfelABTo6vN7Bf3zSAc/CqPCADo0aKqFzb2k8IcYicpocwz8iuQw/oaRNasWDS3juoJF2/cq5fFaAFq+JYzCgeaAguLC8/p4amhJEkTmrCCMlZ/++p2fP/BVLvlkl0FhiiGE6KX3ZIBvaG0L/V5/aatbLPUX0yAz6zrDMdCeanfbJm9PA8iVgDMi1I148TR7q7ZIqTbFR2hLSPcqP3DOhdKzA3tNxiKnbIiJtfsQjVITr1lfxHojd360azIwTqRoRq/DE1nQpIjIIJ23PIKNx8K1rOiw2Ji7uxNwvokb+cKDvtmD7Te6wLmw7bnOLe/tnT1Fv14dMH5FKgAUir/ZdOKx/4V33j5YBRBljFRK54myz0W8tCG9BlFLLd01mew0pIS7flpWQKE="


script:
- python manage.py migrate
Expand Down
18 changes: 13 additions & 5 deletions connect/api/v1/tests/test_organization.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
OrganizationAuthorizationViewSet,
)
from connect.api.v1.tests.utils import create_user_and_token
from connect.common.models import Organization, OrganizationAuthorization
from connect.common.models import Organization, OrganizationAuthorization, BillingPlan


class CreateOrganizationAPITestCase(TestCase):
Expand Down Expand Up @@ -70,7 +70,9 @@ def setUp(self):
self.owner, self.owner_token = create_user_and_token("owner")

self.organization = Organization.objects.create(
name="test organization", description="", inteligence_organization=1
name="test organization", description="", inteligence_organization=1,
organization_billing__cycle=BillingPlan.BILLING_CYCLE_MONTHLY,
organization_billing__plan="free",
)
self.organization_authorization = self.organization.authorizations.create(
user=self.owner, role=OrganizationAuthorization.ROLE_ADMIN
Expand Down Expand Up @@ -110,7 +112,9 @@ def setUp(self):
self.user, self.user_token = create_user_and_token()

self.organization = Organization.objects.create(
name="test organization", description="", inteligence_organization=1
name="test organization", description="", inteligence_organization=1,
organization_billing__cycle=BillingPlan.BILLING_CYCLE_MONTHLY,
organization_billing__plan="free",
)
self.organization_authorization = self.organization.authorizations.create(
user=self.owner, role=OrganizationAuthorization.ROLE_ADMIN
Expand Down Expand Up @@ -165,7 +169,9 @@ def setUp(self):
self.user, self.user_token = create_user_and_token()

self.organization = Organization.objects.create(
name="test organization", description="", inteligence_organization=1
name="test organization", description="", inteligence_organization=1,
organization_billing__cycle=BillingPlan.BILLING_CYCLE_MONTHLY,
organization_billing__plan="free",
)
self.organization_authorization = self.organization.authorizations.create(
user=self.owner, role=OrganizationAuthorization.ROLE_ADMIN
Expand Down Expand Up @@ -232,7 +238,9 @@ def setUp(self):
self.user, self.user_token = create_user_and_token()

self.organization = Organization.objects.create(
name="test organization", description="", inteligence_organization=1
name="test organization", description="", inteligence_organization=1,
organization_billing__cycle=BillingPlan.BILLING_CYCLE_MONTHLY,
organization_billing__plan="free",
)
self.organization_authorization = self.organization.authorizations.create(
user=self.owner, role=OrganizationAuthorization.ROLE_ADMIN
Expand Down
14 changes: 10 additions & 4 deletions connect/api/v1/tests/test_project.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@

from connect.api.v1.project.views import ProjectViewSet
from connect.api.v1.tests.utils import create_user_and_token
from connect.common.models import OrganizationAuthorization, Project, Organization
from connect.common.models import OrganizationAuthorization, Project, Organization, BillingPlan


class CreateProjectAPITestCase(TestCase):
Expand All @@ -18,7 +18,9 @@ def setUp(self):
self.owner, self.owner_token = create_user_and_token("owner")

self.organization = Organization.objects.create(
name="test organization", description="", inteligence_organization=1
name="test organization", description="", inteligence_organization=1,
organization_billing__cycle=BillingPlan.BILLING_CYCLE_MONTHLY,
organization_billing__plan="free",
)
self.organization_authorization = self.organization.authorizations.create(
user=self.owner, role=OrganizationAuthorization.ROLE_ADMIN
Expand Down Expand Up @@ -64,7 +66,9 @@ def setUp(self):
self.owner, self.owner_token = create_user_and_token("owner")

self.organization = Organization.objects.create(
name="test organization", description="", inteligence_organization=1
name="test organization", description="", inteligence_organization=1,
organization_billing__cycle=BillingPlan.BILLING_CYCLE_MONTHLY,
organization_billing__plan="free",
)
self.organization_authorization = self.organization.authorizations.create(
user=self.owner, role=OrganizationAuthorization.ROLE_ADMIN
Expand Down Expand Up @@ -111,7 +115,9 @@ def setUp(self):
self.user, self.user_token = create_user_and_token("user")

self.organization = Organization.objects.create(
name="test organization", description="", inteligence_organization=1
name="test organization", description="", inteligence_organization=1,
organization_billing__cycle=BillingPlan.BILLING_CYCLE_MONTHLY,
organization_billing__plan="free",
)
self.organization_authorization = self.organization.authorizations.create(
user=self.owner, role=OrganizationAuthorization.ROLE_ADMIN
Expand Down
2 changes: 1 addition & 1 deletion connect/billing/tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ def setUp(self):
self.merchant = get_gateway("stripe")
stripe.api_key = self.merchant.stripe.api_key
self.stripe = stripe
self.customer = "cus_Jvmmq0P9aEP8Fw"
self.customer = "cus_KUcb4t9fIpXqqr"

def testPurchase(self):
resp = self.merchant.purchase(10, self.customer)
Expand Down
4 changes: 2 additions & 2 deletions connect/common/management/commands/teste.py
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
import datetime

from dateutil.relativedelta import relativedelta
# from dateutil.relativedelta import relativedelta
from django.core.management.base import BaseCommand
from google.protobuf.timestamp_pb2 import Timestamp

from connect import utils
from connect.common.models import Invoice, BillingPlan
# from connect.common.models import Invoice, BillingPlan


class Command(BaseCommand):
Expand Down
9 changes: 7 additions & 2 deletions connect/common/tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
OrganizationAuthorization,
ServiceStatus,
NewsletterLanguage,
BillingPlan
)


Expand All @@ -33,7 +34,9 @@ def setUp(self):
self.owner = User.objects.create_user("owner@user.com", "owner")

self.organization = Organization.objects.create(
name="Test", inteligence_organization=0
name="Test", inteligence_organization=0,
organization_billing__cycle=BillingPlan.BILLING_CYCLE_MONTHLY,
organization_billing__plan="free",
)
self.project = self.organization.project.create(
name="project test",
Expand Down Expand Up @@ -77,7 +80,9 @@ def setUp(self):
self.user = User.objects.create_user("fake@user.com", "user")

self.organization = Organization.objects.create(
name="Test", inteligence_organization=0
name="Test", inteligence_organization=0,
organization_billing__cycle=BillingPlan.BILLING_CYCLE_MONTHLY,
organization_billing__plan="free",
)
self.organization_authorization = self.organization.authorizations.create(
user=self.owner, role=OrganizationAuthorization.ROLE_ADMIN
Expand Down

0 comments on commit 80bafe6

Please sign in to comment.