예제 #1
0
 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)
예제 #2
0
    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)
예제 #3
0
def jr():
    """
    A plain Twisted JSONRenderer.
    """
    return JSONRenderer()