[damned-lies/issue232] Fixes #232 - Avoid failing tests with Django 3.2.1
- From: Claude Paroz <claudep src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [damned-lies/issue232] Fixes #232 - Avoid failing tests with Django 3.2.1
- Date: Wed, 5 May 2021 20:24:54 +0000 (UTC)
commit 6d342f9fd3381b9b4096f0479984a5b17e3632a3
Author: Claude Paroz <claude 2xlibre net>
Date: Wed May 5 22:24:32 2021 +0200
Fixes #232 - Avoid failing tests with Django 3.2.1
vertimus/models.py | 4 ++--
vertimus/tests/tests.py | 2 +-
2 files changed, 3 insertions(+), 3 deletions(-)
---
diff --git a/vertimus/models.py b/vertimus/models.py
index 71616a65..23fcca09 100644
--- a/vertimus/models.py
+++ b/vertimus/models.py
@@ -479,7 +479,7 @@ class Action(ActionAbstract):
state.save()
self.state_db = state
if self.file:
- self.file.save(self.file.name, self.file, save=False)
+ self.file.save(os.path.basename(self.file.name), self.file, save=False)
if form_data.get('comment'):
self.comment = form_data['comment']
self.sent_to_ml = form_data.get('send_to_ml', False)
@@ -756,7 +756,7 @@ class ActionAA(Action):
comment=action.comment,
file=file_to_archive)
if file_to_archive:
- action_archived.file.save(action.file.name, file_to_archive, save=False)
+ action_archived.file.save(os.path.basename(action.file.name), file_to_archive, save=False)
if sequence is None:
# The ID is available after the save()
diff --git a/vertimus/tests/tests.py b/vertimus/tests/tests.py
index 994d7b81..01822729 100644
--- a/vertimus/tests/tests.py
+++ b/vertimus/tests/tests.py
@@ -742,7 +742,7 @@ class VertimusTest(TeamsAndRolesMixin, TestCase):
with valid_path.open() as test_file:
action = Action.new_by_name('UT', person=self.pt, file=File(test_file))
action.state_db = state
- action.file.save(action.file.name, action.file, save=False)
+ action.file.save(os.path.basename(action.file.name), action.file, save=False)
action.merged_file = None
action.save()
response = self.client.get(reverse('action-quality-check', args=[action.pk]))
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]