mirror of
https://github.com/apache/superset.git
synced 2026-04-19 08:04:53 +00:00
chore: enable lint PT009 'use regular assert over self.assert.*' (#30521)
This commit is contained in:
committed by
GitHub
parent
1f013055d2
commit
a849c29288
@@ -53,8 +53,8 @@ class EncryptedFieldTest(SupersetTestCase):
|
||||
|
||||
def test_create_field(self):
|
||||
field = encrypted_field_factory.create(String(1024))
|
||||
self.assertTrue(isinstance(field, EncryptedType))
|
||||
self.assertEqual(self.app.config["SECRET_KEY"], field.key)
|
||||
assert isinstance(field, EncryptedType)
|
||||
assert self.app.config["SECRET_KEY"] == field.key
|
||||
|
||||
def test_custom_adapter(self):
|
||||
self.app.config["SQLALCHEMY_ENCRYPTED_FIELD_TYPE_ADAPTER"] = (
|
||||
@@ -62,10 +62,10 @@ class EncryptedFieldTest(SupersetTestCase):
|
||||
)
|
||||
encrypted_field_factory.init_app(self.app)
|
||||
field = encrypted_field_factory.create(String(1024))
|
||||
self.assertTrue(isinstance(field, StringEncryptedType))
|
||||
self.assertFalse(isinstance(field, EncryptedType))
|
||||
self.assertTrue(getattr(field, "__created_by_enc_field_adapter__"))
|
||||
self.assertEqual(self.app.config["SECRET_KEY"], field.key)
|
||||
assert isinstance(field, StringEncryptedType)
|
||||
assert not isinstance(field, EncryptedType)
|
||||
assert getattr(field, "__created_by_enc_field_adapter__")
|
||||
assert self.app.config["SECRET_KEY"] == field.key
|
||||
|
||||
def test_ensure_encrypted_field_factory_is_used(self):
|
||||
"""
|
||||
|
||||
@@ -25,7 +25,7 @@ class MachineAuthProviderTests(SupersetTestCase):
|
||||
def test_get_auth_cookies(self):
|
||||
user = self.get_user("admin")
|
||||
auth_cookies = machine_auth_provider_factory.instance.get_auth_cookies(user)
|
||||
self.assertIsNotNone(auth_cookies["session"])
|
||||
assert auth_cookies["session"] is not None
|
||||
|
||||
@patch("superset.utils.machine_auth.MachineAuthProvider.get_auth_cookies")
|
||||
def test_auth_driver_user(self, get_auth_cookies):
|
||||
|
||||
Reference in New Issue
Block a user