예제 #1
0
    def test_get_active_paid_org_should_not_return_deactivate_org(self):
        ORG_DETAILS = {
            'organization_name': 'myCompany',
            'organization_sector': 'Public Health',
            'organization_city': 'xian',
            'organization_country': 'china',
            'organization_address': 'myAddress',
            'organization_addressline2': 'myAddressL2',
            'organization_state': "MyState",
            'organization_zipcode': "1234565",
            'organization_office_phone': "123113123",
            'organization_website': "*****@*****.**",
            'language': "en"
        }
        deactivated_organization = Organization.create_organization(
            ORG_DETAILS)
        deactivated_organization.status = "Deactivated"
        deactivated_organization.save()

        activated_organization = Organization.create_organization(ORG_DETAILS)
        activated_organization.status = 'Activated'
        activated_organization.save()

        organizations = _get_active_paid_organization()

        self.assertNotIn(deactivated_organization, organizations)
        self.assertIn(activated_organization, organizations)

        activated_organization.delete()
        deactivated_organization.delete()
 def create_respective_organization(self, kwargs):
     if self.is_subscription_registration(kwargs):
         organization = Organization.create_organization(kwargs)
     else:
         organization = Organization.create_trial_organization(kwargs)
     return organization