예제 #1
0
    def test_update_site(self):
        """ Verify the command updates Site and SiteConfiguration. """
        expected_site_domain = self.faker.domain_name()
        expected_site_name = 'Fake Credentials Server'
        site = SiteFactory()

        self._call_command(site_id=site.id,
                           site_domain=expected_site_domain,
                           site_name=expected_site_name)

        site.refresh_from_db()

        self.assertEqual(site.domain, expected_site_domain)
        self.assertEqual(site.name, expected_site_name)
        self._check_site_configuration(site.siteconfiguration)
예제 #2
0
 def setUp(self):
     self.site = SiteFactory()
     self.program = ProgramFactory(site=self.site)
     self.certificate = self.cert_factory.create(program_uuid=self.program.uuid, site=self.site)
     self.username = '******'
     self.user = UserFactory(username=self.username)
     self.user_cred = self.issuer.issue_credential(self.certificate, self.username)
     self.attributes = [{"name": "whitelist_reason", "value": "Reason for whitelisting."}]
예제 #3
0
 def setUp(self):
     super().setUp()
     self.site = SiteFactory()
예제 #4
0
 def test_str(self):
     """ Test the site value for site configuration model. """
     site = SiteFactory(domain="test.org", name="test")
     site_configuration = SiteConfigurationFactory(site=site)
     self.assertEqual(str(site_configuration), site.name)
예제 #5
0
 def setUp(self):
     super(ParseTests, self).setUp()
     self.site = SiteFactory()
예제 #6
0
 def setUp(self):
     super().setUp()
     self.site = SiteFactory()
     # Indexes into API_RESPONSES
     self.api_call_count = 0
예제 #7
0
 def test_unicode(self):
     """ Test the site value for site configuration model. """
     site = SiteFactory(domain='test.org', name='test')
     site_configuration = SiteConfigurationFactory(site=site)
     self.assertEqual(unicode(site_configuration), site.name)