'has_key is now deprecated.'

def test_has_keyDeprecation(self):

    sut = mail.mail.DomainWithDefaultDict({}, 'Default')
    sut.has_key('anything')
    message = 'twisted.mail.mail.DomainWithDefaultDict.has_key    was    deprecated    in    Twisted    16.3.0.    Use    the    `in`    keyword    instead.'
    warnings = self.flushWarnings([self.test_has_keyDeprecation])
    self.assertEqual(1, len(warnings))
    self.assertEqual(DeprecationWarning, warnings[0]['category'])
    self.assertEqual(message, warnings[0]['message'])
