Changement du refresh handler, soft reset d'ajouter sur beaucoup de formulaire de modification
CI - Security, Lint & Tests / validate (push) Failing after 1m3s
CI - Security, Lint & Tests / validate (push) Failing after 1m3s
This commit is contained in:
@@ -41,7 +41,9 @@ class TestBackupCreate:
|
||||
|
||||
as_role('admin')
|
||||
response = client.post(
|
||||
'/admin/backup/create', data={'notes': 'test backup'}, follow_redirects=False,
|
||||
'/admin/backup/create',
|
||||
data={'notes': 'test backup'},
|
||||
follow_redirects=False,
|
||||
)
|
||||
assert _redirected(response)
|
||||
|
||||
@@ -61,7 +63,9 @@ class TestBackupCreate:
|
||||
|
||||
as_role('admin')
|
||||
response = client.post(
|
||||
'/admin/backup/create', data={}, follow_redirects=True,
|
||||
'/admin/backup/create',
|
||||
data={},
|
||||
follow_redirects=True,
|
||||
)
|
||||
html = response.data.decode()
|
||||
assert 'Backup failed' in html
|
||||
@@ -135,7 +139,8 @@ class TestBackupDownload:
|
||||
record_id = record.id
|
||||
|
||||
response = client.get(
|
||||
f'/admin/backup/{record_id}/download', follow_redirects=True,
|
||||
f'/admin/backup/{record_id}/download',
|
||||
follow_redirects=True,
|
||||
)
|
||||
html = response.data.decode()
|
||||
assert 'missing from disk' in html.lower()
|
||||
@@ -162,7 +167,8 @@ class TestBackupDelete:
|
||||
record_id = record.id
|
||||
|
||||
response = client.post(
|
||||
f'/admin/backup/{record_id}/delete', follow_redirects=False,
|
||||
f'/admin/backup/{record_id}/delete',
|
||||
follow_redirects=False,
|
||||
)
|
||||
assert _redirected(response)
|
||||
|
||||
@@ -214,14 +220,13 @@ class TestBackupRestore:
|
||||
record_id = record.id
|
||||
|
||||
response = client.post(
|
||||
f'/admin/backup/{record_id}/restore', follow_redirects=True,
|
||||
f'/admin/backup/{record_id}/restore',
|
||||
follow_redirects=True,
|
||||
)
|
||||
html = response.data.decode()
|
||||
assert 'missing from disk' in html.lower()
|
||||
|
||||
def test_restore_creates_safety_backup_first(
|
||||
self, app, client, as_role, monkeypatch, tmp_path
|
||||
):
|
||||
def test_restore_creates_safety_backup_first(self, app, client, as_role, monkeypatch, tmp_path):
|
||||
import app.routes.admin as admin_module
|
||||
|
||||
# The restore route parses DATABASE_URL outside its try block.
|
||||
@@ -282,4 +287,4 @@ class TestBackupRestore:
|
||||
with app.app_context():
|
||||
safety = BackupRecord.query.filter_by(filename='db_backup_safety.dump').first()
|
||||
assert safety is not None
|
||||
assert safety.backup_type == 'pre_restore'
|
||||
assert safety.backup_type == 'pre_restore'
|
||||
|
||||
Reference in New Issue
Block a user