Commit 5d6ec2c358724a59bc9e5f4c7da49ee6687a3ac3

Authored by mykhaly
1 parent 2e151f46

Add "id" to document prefix in create_fake_doc

@@ -39,7 +39,8 @@ def translate_country_ru(country): @@ -39,7 +39,8 @@ def translate_country_ru(country):
39 def create_fake_doc(): 39 def create_fake_doc():
40 content = fake.text() 40 content = fake.text()
41 suffix = fake.random_element(('.doc', '.docx', '.pdf')) 41 suffix = fake.random_element(('.doc', '.docx', '.pdf'))
42 - tf = NamedTemporaryFile(delete=False, suffix=suffix) 42 + prefix = "{}-{}{}".format("d", fake.uuid4()[:8], fake_en.word())
  43 + tf = NamedTemporaryFile(delete=False, suffix=suffix, prefix=prefix)
43 tf.write(content) 44 tf.write(content)
44 tf.close() 45 tf.close()
45 return tf.name 46 return tf.name
Please register or login to post a comment