mirror of
				https://github.com/zulip/zulip.git
				synced 2025-11-04 05:53:43 +00:00 
			
		
		
		
	We now have this API...
If you really just need to log in
and not do anything with the actual
user:
    self.login('hamlet')
If you're gonna use the user in the
rest of the test:
    hamlet = self.example_user('hamlet')
    self.login_user(hamlet)
If you are specifically testing
email/password logins (used only in 4 places):
    self.login_by_email(email, password)
And for failures uses this (used twice):
    self.assert_login_failure(email)
		
	
		
			
				
	
	
		
			24 lines
		
	
	
		
			714 B
		
	
	
	
		
			Python
		
	
	
	
	
	
			
		
		
	
	
			24 lines
		
	
	
		
			714 B
		
	
	
	
		
			Python
		
	
	
	
	
	
from zerver.lib.test_classes import (
 | 
						|
    ZulipTestCase,
 | 
						|
)
 | 
						|
 | 
						|
class LegacySubjectTest(ZulipTestCase):
 | 
						|
    def test_legacy_subject(self) -> None:
 | 
						|
        self.login('hamlet')
 | 
						|
 | 
						|
        payload = dict(
 | 
						|
            type='stream',
 | 
						|
            to='Verona',
 | 
						|
            client='test suite',
 | 
						|
            content='Test message',
 | 
						|
        )
 | 
						|
 | 
						|
        payload['subject'] = 'whatever'
 | 
						|
        result = self.client_post("/json/messages", payload)
 | 
						|
        self.assert_json_success(result)
 | 
						|
 | 
						|
        # You can't use both subject and topic.
 | 
						|
        payload['topic'] = 'whatever'
 | 
						|
        result = self.client_post("/json/messages", payload)
 | 
						|
        self.assert_json_error(result, "Can't decide between 'topic' and 'subject' arguments")
 |