Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitb19497d

Browse files
authored
Minor PR to organize migrations (python#1851)
* Add missing migration from contract updates* Remove created file so tests can be idempotent
1 parent743b53b commitb19497d

File tree

2 files changed

+39
-0
lines changed

2 files changed

+39
-0
lines changed
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
# Generated by Django 2.0.13 on 2021-08-26 19:29
2+
3+
fromdjango.dbimportmigrations,models
4+
importsponsors.models
5+
6+
7+
classMigration(migrations.Migration):
8+
9+
dependencies= [
10+
('sponsors','0034_contract_document_docx'),
11+
]
12+
13+
operations= [
14+
migrations.AlterField(
15+
model_name='contract',
16+
name='document',
17+
field=models.FileField(blank=True,upload_to='sponsors/contracts/',verbose_name='Unsigned PDF'),
18+
),
19+
migrations.AlterField(
20+
model_name='contract',
21+
name='document_docx',
22+
field=models.FileField(blank=True,upload_to='sponsors/contracts/docx/',verbose_name='Unsigned Docx'),
23+
),
24+
migrations.AlterField(
25+
model_name='contract',
26+
name='signed_document',
27+
field=models.FileField(blank=True,upload_to=sponsors.models.signed_contract_random_path,verbose_name='Signed PDF'),
28+
),
29+
]

‎sponsors/tests/test_use_cases.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
1+
importos
12
fromunittest.mockimportMock,patch
23
frommodel_bakeryimportbaker
34
fromdatetimeimporttimedelta,date
5+
frompathlibimportPath
46

57
fromdjango.confimportsettings
68
fromdjango.testimportTestCase
@@ -186,6 +188,14 @@ def setUp(self):
186188
self.file=SimpleUploadedFile("contract.txt",b"Contract content")
187189
self.contract=baker.make_recipe("sponsors.tests.empty_contract",status=Contract.DRAFT)
188190

191+
deftearDown(self):
192+
try:
193+
signed_file=Path(self.contract.signed_document.path)
194+
ifsigned_file.exists():
195+
os.remove(str(signed_file.resolve()))
196+
exceptValueError:
197+
pass
198+
189199
@patch("sponsors.models.uuid.uuid4",Mock(return_value="1234"))
190200
deftest_execute_and_update_database_object(self):
191201
self.use_case.execute(self.contract,self.file)

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp