def test_return_also_raw(self): xq = Xquery(xpath='/el') xq.xq_var = '$n' xq._raw_prefix = 'r_' xq.return_also({'myid': 'count(util:expand(%(xq_var)s/@id))'}, raw=True) self.assert_('<r_myid>{count(util:expand($n/@id))}</r_myid>' in xq._constructReturn()) xq = Xquery(xpath='/el') xq.xq_var = '$n' xq._raw_prefix = 'r_' xq.return_also({'myid': '@id'}, raw=True) self.assert_('<r_myid>{@id}</r_myid>' in xq._constructReturn())