示例#1
0
    def get_fq(self):
        fq = [
            force_text(self.field_query[0]._meta.app_label),
            force_text(self.field_query[0]._meta.object_name),
            self.field_query[1],
        ]

        fq_val = 'FQ:%s' % '.'.join(fq)

        if fq_encrypt_disabled():
            return fq_val
        else:
            return FqCrypto.encode(fq_val)
示例#2
0
    def get_fq(self):
        fq = [
            force_text(self.field_query[0]._meta.app_label),
            force_text(self.field_query[0]._meta.object_name),
            self.field_query[1],
        ]

        fq_val = 'FQ:%s' % '.'.join(fq)

        if fq_encrypt_disabled():
            return fq_val
        else:
            return FqCrypto.encode(fq_val)
示例#3
0
    def test_settings_overwrite(self):
        with self.settings(THOR_UPLOAD_TO='other-path'):
            self.assertEquals(get_upload_path(), 'other-path')

        with self.settings(THOR_EXPIRE_TIME=500):
            self.assertEquals(get_expiry_time(), 500)

        with self.settings(THOR_LINKED_EXPIRE_TIME=666):
            self.assertEquals(get_linked_expiry_time(), 666)

        with self.settings(THOR_MAX_FILE_SIZE=666):
            self.assertEquals(get_max_file_size(), 666)

        with self.settings(THOR_DISABLE_FQ_ENCRYPT=True):
            self.assertEquals(fq_encrypt_disabled(), True)

        with self.settings(THOR_ENABLE_ADMIN=False):
            self.assertEquals(show_in_admin(), False)
示例#4
0
    def test_settings_overwrite(self):
        with self.settings(THOR_UPLOAD_TO='other-path'):
            self.assertEquals(get_upload_path(), 'other-path')

        with self.settings(THOR_EXPIRE_TIME=500):
            self.assertEquals(get_expiry_time(), 500)

        with self.settings(THOR_LINKED_EXPIRE_TIME=666):
            self.assertEquals(get_linked_expiry_time(), 666)

        with self.settings(THOR_MAX_FILE_SIZE=666):
            self.assertEquals(get_max_file_size(), 666)

        with self.settings(THOR_DISABLE_FQ_ENCRYPT=True):
            self.assertEquals(fq_encrypt_disabled(), True)

        with self.settings(THOR_ENABLE_ADMIN=False):
            self.assertEquals(show_in_admin(), False)