Beispiel #1
0
class TestHostedCCZLink(TestCase):
    raw_password = "******"

    def setUp(self):
        super(TestHostedCCZLink, self).setUp()
        self.link = HostedCCZLink(username="******", domain="test", identifier="abcdef",
                                  password=self.raw_password)

    def tearDown(self):
        if self.link.pk:
            self.link.delete()

    def test_valid_link(self):
        self.link.full_clean()
        self.link.save()

    def test_identifier_validation(self):
        self.link.identifier = "123-abd"
        with self.assertRaisesMessage(ValidationError, "must be lowercase alphanumeric"):
            self.link.full_clean()

    def test_encrypted_password(self):
        self.link.save()
        self.assertNotEqual(self.link.password, self.raw_password)
        self.assertTrue(verify_password(self.raw_password, self.link.password),
                        "encrypted password does not match")
 def setUp(self):
     super(TestHostedCCZLinkSerializer, self).setUp()
     self.link = HostedCCZLink(username="******",
                               domain="test",
                               identifier="abcdef",
                               page_title="page title")
     self.link.password = hash_password(self.raw_password)
 def setUp(self):
     super(TestSetUpCCZFileForHosting, self).setUp()
     self.link = HostedCCZLink(username="******",
                               password="******",
                               identifier="link1234",
                               domain="test")
     self.hosted_ccz = HostedCCZ(link=self.link,
                                 app_id="dummy",
                                 version=12,
                                 profile_id="123456")
Beispiel #4
0
 def setUp(self):
     super(TestHostedCCZLink, self).setUp()
     self.link = HostedCCZLink(username="******", domain="test", identifier="abcdef",
                               password=self.raw_password)