Пример #1
0
 def test_fq_long_encrypt(self):
     with self.settings(SECRET_KEY='F00Basddsasasedqweqwasdeqweqwgkdfkdslfksflqi'
                                   'weuwiqeuqwieuiqweasdswqeqwewqeqweasds'
                                   'dasddasdsaasdasdsaddasA4', THOR_DISABLE_FQ_ENCRYPT=False):
         encoded = FqCrypto.encode(self.FQ_VAL)
         self.assertEquals(encoded, self.FQ_ENC_LONG)
         self.assertEquals(FqCrypto.decode(encoded), self.FQ_VAL)
Пример #2
0
 def test_fq_long_encrypt(self):
     with self.settings(
             SECRET_KEY='F00Basddsasasedqweqwasdeqweqwgkdfkdslfksflqi'
             'weuwiqeuqwieuiqweasdswqeqwewqeqweasds'
             'dasddasdsaasdasdsaddasA4',
             THOR_DISABLE_FQ_ENCRYPT=False):
         encoded = FqCrypto.encode(self.FQ_VAL)
         self.assertEquals(encoded, self.FQ_ENC_LONG)
         self.assertEquals(FqCrypto.decode(encoded), self.FQ_VAL)
Пример #3
0
    def parse_field_component(cls, component):

        if component[:3] != "FQ:":
            component = FqCrypto.decode(component)

        mat = cls.FQ_REGEX.match(component)
        if mat:
            return mat.group(1), mat.group(2), mat.group(3)

        return None
Пример #4
0
    def parse_field_component(cls, component):

        if component[:3] != 'FQ:':
            component = FqCrypto.decode(component)

        mat = cls.FQ_REGEX.match(component)
        if mat:
            return mat.group(1), mat.group(2), mat.group(3)

        return None
Пример #5
0
 def test_fq_encrypt_disable(self):
     with self.settings(SECRET_KEY='F00BA4', THOR_DISABLE_FQ_ENCRYPT=True):
         encoded = FqCrypto.encode(self.FQ_VAL)
         self.assertEquals(encoded, self.FQ_VAL)
         self.assertEquals(FqCrypto.decode(encoded), self.FQ_VAL)
Пример #6
0
 def test_fq_encrypt_disable(self):
     with self.settings(SECRET_KEY='F00BA4', THOR_DISABLE_FQ_ENCRYPT=True):
         encoded = FqCrypto.encode(self.FQ_VAL)
         self.assertEquals(encoded, self.FQ_VAL)
         self.assertEquals(FqCrypto.decode(encoded), self.FQ_VAL)