mirror of
https://github.com/spl0k/supysonic.git
synced 2024-12-22 08:56:17 +00:00
black
This commit is contained in:
parent
d5a4f1856c
commit
be6b617e60
@ -628,7 +628,9 @@ def init_database(database_uri):
|
||||
|
||||
if ext == ".sql":
|
||||
with db.atomic():
|
||||
execute_sql_resource_script(f"schema/migration/{provider}/{migration}")
|
||||
execute_sql_resource_script(
|
||||
f"schema/migration/{provider}/{migration}"
|
||||
)
|
||||
elif ext == ".py":
|
||||
m = importlib.import_module(
|
||||
f".schema.migration.{provider}.{date}", __package__
|
||||
|
@ -104,7 +104,9 @@ class UserManagerTestCase(unittest.TestCase):
|
||||
# Delete existing users
|
||||
for name in ["alice", "bob", "charlie"]:
|
||||
user = db.User.get(name=name)
|
||||
db.ClientPrefs.create(user=user, client_name="tests") # test for FK handling
|
||||
db.ClientPrefs.create(
|
||||
user=user, client_name="tests"
|
||||
) # test for FK handling
|
||||
UserManager.delete(user.id)
|
||||
self.assertRaises(db.User.DoesNotExist, db.User.__getitem__, user.id)
|
||||
self.assertEqual(db.User.select().count(), 0)
|
||||
@ -115,7 +117,9 @@ class UserManagerTestCase(unittest.TestCase):
|
||||
# Delete existing users
|
||||
for name in ["alice", "bob", "charlie"]:
|
||||
user = db.User.get(name=name)
|
||||
db.ClientPrefs.create(user=user, client_name="tests") # test for FK handling
|
||||
db.ClientPrefs.create(
|
||||
user=user, client_name="tests"
|
||||
) # test for FK handling
|
||||
UserManager.delete_by_name(name)
|
||||
self.assertFalse(db.User.select().where(db.User.name == name).exists())
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user