mirror of
				https://github.com/zulip/zulip.git
				synced 2025-11-03 21:43:21 +00:00 
			
		
		
		
	send_email: Enforce in tests that all send_email calls JSON-roundtrip.
This commit is contained in:
		
				
					committed by
					
						
						Tim Abbott
					
				
			
			
				
	
			
			
			
						parent
						
							33f7da23a0
						
					
				
				
					commit
					aa63b40f27
				
			@@ -358,6 +358,11 @@ def send_email(
 | 
			
		||||
            ),
 | 
			
		||||
        )
 | 
			
		||||
    else:
 | 
			
		||||
        if settings.TEST_SUITE:
 | 
			
		||||
            # In tests, verify that the context object is
 | 
			
		||||
            # JSON-serializable, as may happen in production using
 | 
			
		||||
            # EMAIL_ALWAYS_ENQUEUED, above.
 | 
			
		||||
            context = orjson.loads(orjson.dumps(context))
 | 
			
		||||
        send_immediate_email(
 | 
			
		||||
            template_prefix,
 | 
			
		||||
            to_user_ids,
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user