Skip to content
This repository has been archived by the owner on Mar 28, 2019. It is now read-only.

Commit

Permalink
Switch to ujson 1.35
Browse files Browse the repository at this point in the history
  • Loading branch information
leplatrem committed Jan 21, 2016
1 parent 331c953 commit 03a70ef
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 3 deletions.
4 changes: 4 additions & 0 deletions cliquet/tests/test_views_hello.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,10 @@ def test_returns_info_about_url_and_version(self):
self.assertEqual(response.json['documentation'],
'https://cliquet.rtfd.org/')

def test_does_not_escape_forward_slashes(self):
response = self.app.get('/')
self.assertNotIn('\\/', response.body)

def test_do_not_returns_eos_if_empty_in_settings(self):
response = self.app.get('/')
self.assertNotIn('eos', response.json)
Expand Down
5 changes: 3 additions & 2 deletions cliquet/utils.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import ast
import functools
import hashlib
import hmac
import os
Expand All @@ -9,9 +10,9 @@
from binascii import hexlify
from six.moves.urllib import parse as urlparse

# ultrajson is not installable with pypy
# ujson is not installable with pypy
try:
import ultrajson as json # NOQA
import ujson as json # NOQA

def json_serializer(v, **kw):
return json.dumps(v, escape_forward_slashes=False)
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
]
else:
# ujson is not pypy compliant, as it uses the CPython C API
REQUIREMENTS.append('ultrajson')
REQUIREMENTS.append('ujson >= 1.35')
POSTGRESQL_REQUIRES = [
'SQLAlchemy',
'psycopg2>2.5',
Expand Down

0 comments on commit 03a70ef

Please sign in to comment.