def test_activate_orgs(self): """Ensure method activates organizations and w/o specified org_model""" org = Organization.objects.create(name="Test", slug="kjadkjkaj", is_active=False) org.add_user(self.user) self.assertFalse(org.is_active) backend = InvitationBackend() backend.activate_organizations(self.user) refreshed_org = Organization.objects.get(pk=org.pk) self.assertTrue(refreshed_org.is_active)
def test_activate_orgs(self): """Ensure no errors raised because correct relation name used""" user = User.objects.create(username="******", email="*****@*****.**") backend = InvitationBackend(org_model=Vendor) backend.activate_organizations(user)
def test_activate_orgs_abstract(self, account_user): backend = InvitationBackend(org_model=CustomOrganization) backend.activate_organizations(account_user)
def test_activate_orgs_vendor(self, account_user): """Ensure no errors raised because correct relation name used""" backend = InvitationBackend(org_model=Vendor) backend.activate_organizations(account_user)
def test_activate_orgs_abstract(self): user = User.objects.create(username="******", email="*****@*****.**") backend = InvitationBackend(org_model=CustomOrganization) backend.activate_organizations(user)