def test_dumpsKWsAreHandedThrough(self, jr): """ JSONRenderer allows for setting arguments that are passed to json.dumps(). Make sure they are passed. """ d = OrderedDict(x='foo') d.update(a='bar') jr_sorted = JSONRenderer(sort_keys=True) assert jr_sorted(None, 'err', d) != jr(None, 'err', d)
def test_dumpsKWsAreHandedThrough(self, jr): """ JSONRenderer allows for setting arguments that are passed to json.dumps(). Make sure they are passed. """ d = {"x": "foo"} d.update(a="bar") jr_sorted = JSONRenderer(sort_keys=True) assert jr_sorted(None, "err", d) != jr(None, "err", d)
def jr(): """ A plain Twisted JSONRenderer. """ return JSONRenderer()