예제 #1
0
    def test_domain_in_org_domains_list(self):
        profile = dict(email="*****@*****.**")
        self.factory.org.settings[
            models.Organization.SETTING_GOOGLE_APPS_DOMAINS] = ["example.com"]
        self.assertTrue(google_verify_profile(self.factory.org, profile))

        self.factory.org.settings[
            models.Organization.SETTING_GOOGLE_APPS_DOMAINS] = [
                "example.org",
                "example.com",
            ]
        self.assertTrue(google_verify_profile(self.factory.org, profile))

        self.factory.org.settings[
            models.Organization.SETTING_MICROSOFT_APPS_DOMAINS] = [
                "example.com"
            ]
        self.assertTrue(microsoft_verify_profile(self.factory.org, profile))

        self.factory.org.settings[
            models.Organization.SETTING_MICROSOFT_APPS_DOMAINS] = [
                "example.org",
                "example.com",
            ]
        self.assertTrue(microsoft_verify_profile(self.factory.org, profile))
예제 #2
0
 def test_org_in_public_mode_accepts_any_domain(self):
     profile = dict(email="*****@*****.**")
     self.factory.org.settings[models.Organization.SETTING_IS_PUBLIC] = True
     self.factory.org.settings[
         models.Organization.SETTING_GOOGLE_APPS_DOMAINS] = []
     self.assertTrue(google_verify_profile(self.factory.org, profile))
     self.factory.org.settings[
         models.Organization.SETTING_MICROSOFT_APPS_DOMAINS] = []
     self.assertTrue(microsoft_verify_profile(self.factory.org, profile))
예제 #3
0
 def test_user_not_in_domain_but_account_exists(self):
     profile = dict(email="*****@*****.**")
     self.factory.create_user(email="*****@*****.**")
     self.factory.org.settings[
         models.Organization.SETTING_GOOGLE_APPS_DOMAINS] = ["example.org"]
     self.assertTrue(google_verify_profile(self.factory.org, profile))
     self.factory.org.settings[
         models.Organization.SETTING_MICROSOFT_APPS_DOMAINS] = [
             "example.org"
         ]
     self.assertTrue(microsoft_verify_profile(self.factory.org, profile))
예제 #4
0
 def test_no_domain_allowed_for_org(self):
     profile = dict(email="*****@*****.**")
     self.assertFalse(google_verify_profile(self.factory.org, profile))
     self.assertFalse(microsoft_verify_profile(self.factory.org, profile))