mirror of
				https://github.com/django/django.git
				synced 2025-10-31 09:41:08 +00:00 
			
		
		
		
	Refs #35648 -- Added test for addition between SafeString and str in utils_tests.
This commit is contained in:
		
				
					committed by
					
						 nessita
						nessita
					
				
			
			
				
	
			
			
			
						parent
						
							b4c1569eae
						
					
				
				
					commit
					b5c048f5ec
				
			| @@ -121,3 +121,14 @@ class SafeStringTest(SimpleTestCase): | ||||
|         msg = "object has no attribute 'dynamic_attr'" | ||||
|         with self.assertRaisesMessage(AttributeError, msg): | ||||
|             s.dynamic_attr = True | ||||
|  | ||||
|     def test_add_str(self): | ||||
|         s = SafeString("a&b") | ||||
|         cases = [ | ||||
|             ("test", "a&btest"), | ||||
|             ("<p>unsafe</p>", "a&b<p>unsafe</p>"), | ||||
|             (SafeString("<p>safe</p>"), SafeString("a&b<p>safe</p>")), | ||||
|         ] | ||||
|         for case, expected in cases: | ||||
|             with self.subTest(case=case): | ||||
|                 self.assertRenderEqual("{{ s }}", expected, s=s + case) | ||||
|   | ||||
		Reference in New Issue
	
	Block a user