'æµè¯äžè¿è¡CDNéå®åçUA (éåžžäžºCDNæäŸåçåå®¹æåç¬è«)'

def test_cdn_excluded_ua(self):

    self.rv = self.client.get(self.url('/image/jpeg?love=luciaz'), environ_base=env(), headers=headers())
    self.assertEqual('image/jpeg', self.rv.content_type, msg=self.dump())
    self.assertEqual(200, self.rv.status_code, msg=self.dump())
    self.assertEqual(2546631231, crc32(self.rv.data), msg=self.dump())
    self.rv2 = self.client.get(self.url('/image/jpeg?love=luciaz'), environ_base=env(), headers=headers())
    self.assertEqual(self.zmirror.cdn_redirect_code_if_cannot_hard_rewrite, self.rv2.status_code, msg=self.dump())
    self.assertEqual('https://cdn3.zmirror-unittest.com/image/jpeg_{salt}_.bG92ZT1sdWNpYXo=._{salt}_.jpg'.format(salt=self.zmirror.cdn_url_query_encode_salt), self.rv2.location, msg=self.dump())
    self.rv3 = self.client.get(self.url('/image/jpeg?love=luciaz'), environ_base=env(), headers=headers(user_agent=((DEFAULT_USER_AGENT + '    ') + self.zmirror.spider_ua_white_list[0])))
    self.assertEqual('image/jpeg', self.rv3.content_type, msg=self.dump())
    self.assertEqual(200, self.rv3.status_code, msg=self.dump())
    self.assertEqual(2546631231, crc32(self.rv3.data), msg=self.dump())
    rv4 = self.client.get(self.url('/image/jpeg_{salt}_.bG92ZT1sdWNpYXo=._{salt}_.jpg'.format(salt=self.zmirror.cdn_url_query_encode_salt)), environ_base=env(), headers=headers(user_agent=((DEFAULT_USER_AGENT + '    ') + self.zmirror.spider_ua_white_list[0])))
    self.assertEqual('image/jpeg', rv4.content_type, msg=self.dump())
    self.assertEqual(200, rv4.status_code, msg=self.dump())
    self.assertEqual(2546631231, crc32(rv4.data), msg=self.dump())
