diff --git a/test/test_model/test_cookie.py b/test/test_model/test_cookie.py index 7747723..9a311b2 100644 --- a/test/test_model/test_cookie.py +++ b/test/test_model/test_cookie.py @@ -59,6 +59,8 @@ def testMultipleCommits(self): class SecureCookieTest(unittest.TestCase): + """This class is responsible for testing default CRUD behaviour on cookies.""" + def setUp(self) -> None: self.connection = CookieConnection() self.secure_cookie = SecureCookie(self.connection) @@ -178,6 +180,12 @@ def testDeprecatedHasher(self): secure_cookie.cookies["secureCookie"], ) + def testUnsupportedHash(self): + """Validate that a cookie is invalidated when an unsupported hash is used.""" + unsupported_cookie = "unsupported+hash+data" + self.secure_cookie.cookies['secureCookie'] = unsupported_cookie + self.assertEqual(self.secure_cookie.rawcookie, None) + if __name__ == "__main__": - unittest.main(testRunner=unittest.TextTestRunner(verbosity=2)) + unittest.main(testRunner=unittest.TextTestRunner(verbosity=2)) \ No newline at end of file