Test that cache entries can be overwritten
(self)
| 28 | self.assertEqual(result, "你好") |
| 29 | |
| 30 | def test_cache_overwrite(self): |
| 31 | """Test that cache entries can be overwritten""" |
| 32 | cache_instance = cache.TranslationCache("test_engine") |
| 33 | |
| 34 | # Set initial translation |
| 35 | cache_instance.set("hello", "你好") |
| 36 | |
| 37 | # Overwrite with new translation |
| 38 | cache_instance.set("hello", "您好") |
| 39 | |
| 40 | # Verify the new translation is returned |
| 41 | result = cache_instance.get("hello") |
| 42 | self.assertEqual(result, "您好") |
| 43 | |
| 44 | def test_non_string_params(self): |
| 45 | """Test that non-string parameters are automatically converted to JSON""" |