python: Further pyupgrade changes.

Signed-off-by: Anders Kaseorg <anders@zulip.com>
This commit is contained in:
Anders Kaseorg 2020-05-01 21:24:13 -07:00 committed by Tim Abbott
parent 333f7d16c9
commit f5b33f9398
6 changed files with 4 additions and 13 deletions

View File

@ -1,5 +1,4 @@
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
#
# Copyright © 2013 Zulip, Inc.
#
@ -42,7 +41,6 @@ interfaces.
'''
from __future__ import absolute_import
import sys
import logging
import logging.handlers

View File

@ -1,6 +1,3 @@
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.conf import settings
from django.db import migrations
from django.db.backends.postgresql.schema import DatabaseSchemaEditor

View File

@ -1,5 +1,3 @@
# -*- coding: utf-8 -*-
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion

View File

@ -1,5 +1,3 @@
# -*- coding: utf-8 -*-
from django.db import migrations
from django.db.backends.postgresql_psycopg2.schema import DatabaseSchemaEditor
from django.db.migrations.state import StateApps

View File

@ -66,14 +66,14 @@ class AlertWordTests(ZulipTestCase):
self.assert_length(realm_alert_words[user.id], 3)
# Test the case-insensitivity of adding words
do_add_alert_words(user, set(["ALert", "ALERT"]))
do_add_alert_words(user, {"ALert", "ALERT"})
words = user_alert_words(user)
self.assertEqual(set(words), set(self.interesting_alert_word_list))
realm_alert_words = alert_words_in_realm(user.realm)
self.assert_length(realm_alert_words[user.id], 3)
# Test the case-insensitivity of removing words
do_remove_alert_words(user, set(["ALert"]))
do_remove_alert_words(user, {"ALert"})
words = user_alert_words(user)
self.assertEqual(set(words), set(self.interesting_alert_word_list) - {'alert'})
realm_alert_words = alert_words_in_realm(user.realm)

View File

@ -2840,8 +2840,8 @@ class ExternalMethodDictsTests(ZulipTestCase):
external_auth_methods = get_external_method_dicts(get_realm("zephyr"))
# Both idps enabled for the zephyr realm, + github auth.
self.assert_length(external_auth_methods, 3)
self.assertEqual(set([external_auth_methods[0]['name'], external_auth_methods[1]['name']]),
set(['saml:test_idp', 'saml:test_idp2']))
self.assertEqual({external_auth_methods[0]['name'], external_auth_methods[1]['name']},
{'saml:test_idp', 'saml:test_idp2'})
class FetchAuthBackends(ZulipTestCase):
def assert_on_error(self, error: Optional[str]) -> None: