lint, fix tests

This commit is contained in:
dklimpel 2020-03-09 22:13:20 +01:00
parent 885134529f
commit 39f6595b4a
2 changed files with 5 additions and 3 deletions

View File

@ -161,7 +161,9 @@ class BaseProfileHandler(BaseHandler):
profile = yield self.store.get_profileinfo(target_user.localpart) profile = yield self.store.get_profileinfo(target_user.localpart)
if profile.display_name: if profile.display_name:
raise SynapseError( raise SynapseError(
400, "Changing display name is disabled on this server", Codes.FORBIDDEN 400,
"Changing display name is disabled on this server",
Codes.FORBIDDEN,
) )
if len(new_displayname) > MAX_DISPLAYNAME_LEN: if len(new_displayname) > MAX_DISPLAYNAME_LEN:

View File

@ -413,7 +413,7 @@ class ThreepidEmailRestTestCase(unittest.HomeserverTestCase):
def test_add_email_if_disabled(self): def test_add_email_if_disabled(self):
"""Test add mail to profile if disabled """Test add mail to profile if disabled
""" """
self.hs.config.enable_3pid_changes = True self.hs.config.enable_3pid_changes = False
client_secret = "foobar" client_secret = "foobar"
session_id = self._request_token(self.email, client_secret) session_id = self._request_token(self.email, client_secret)
@ -485,7 +485,7 @@ class ThreepidEmailRestTestCase(unittest.HomeserverTestCase):
def test_delete_email_if_disabled(self): def test_delete_email_if_disabled(self):
"""Test delete mail from profile if disabled """Test delete mail from profile if disabled
""" """
self.hs.config.enable_3pid_changes = True self.hs.config.enable_3pid_changes = False
# Add a threepid # Add a threepid
self.get_success( self.get_success(