'L{http.Request.setCookie} will raise a L{DeprecationWarning} if
non-string (not L{bytes} or L{unicode}) arguments are given, and will
call C{str()} on it to preserve past behaviour.'

def test_addCookieNonStringArgument(self):

    expectedCookieValue = 'foo=10'
    self._checkCookie(expectedCookieValue, 'foo', 10)
    warnings = self.flushWarnings([self._checkCookie])
    self.assertEqual(1, len(warnings))
    self.assertEqual(warnings[0]['category'], DeprecationWarning)
    self.assertEqual(warnings[0]['message'], 'Passing    non-bytes    or    non-unicode    cookie    arguments    is    deprecated    since    Twisted    16.1.')
