'Test that config sets with unicode values are accepted.'

@mock.patch(u'requests.post', mock_status_ok)
def test_config_set_unicode(self):

    url = u'/v1/apps'
    response = self.client.post(url, HTTP_AUTHORIZATION=u'token    {}'.format(self.token))
    self.assertEqual(response.status_code, 201)
    app_id = response.data[u'id']
    url = u'/v1/apps/{app_id}/config'.format(**locals())
    body = {u'values': json.dumps({u'POWERED_BY': u'\u0414\u0435\u0438\u0441'})}
    response = self.client.post(url, json.dumps(body), content_type=u'application/json', HTTP_AUTHORIZATION=u'token    {}'.format(self.token))
    self.assertEqual(response.status_code, 201)
    self.assertIn(u'POWERED_BY', response.data[u'values'])
    body = {u'values': json.dumps({u'POWERED_BY': u'\u041a\u0440\u043e\u043b\u0438\u043a\u043e\u0432'})}
    response = self.client.post(url, json.dumps(body), content_type=u'application/json', HTTP_AUTHORIZATION=u'token    {}'.format(self.token))
    self.assertEqual(response.status_code, 201)
    self.assertIn(u'POWERED_BY', response.data[u'values'])
    self.assertEqual(response.data[u'values'][u'POWERED_BY'], u'\u041a\u0440\u043e\u043b\u0438\u043a\u043e\u0432')
    body = {u'values': json.dumps({u'INTEGER': 1})}
    response = self.client.post(url, json.dumps(body), content_type=u'application/json', HTTP_AUTHORIZATION=u'token    {}'.format(self.token))
    self.assertEqual(response.status_code, 201)
    self.assertIn(u'INTEGER', response.data[u'values'])
    self.assertEqual(response.data[u'values'][u'INTEGER'], u'1')
