Commit 4a8b65be authored by Elouan Martinet's avatar Elouan Martinet
Browse files

[test] Try to upload two files with the same key

parent 1733de7c6233
......@@ -41,8 +41,10 @@ class S3StorageTC(testing.S3StorageTestMixin, CubicWebTC):
data = self.s3_bucket.Object(key).get()['Body'].read()
self.assertEqual(data, b'some content')
def test_entity_create_two_files_in_transaction(self):
with self.admin_access.client_cnx() as cnx:
def test_entity_create_with_same_key(self):
with self.admin_access.client_cnx() as cnx, \
patch('cubicweb_s3storage.storages.S3Storage.new_s3_key',
return_value='shared-key'):
eid = create_image(cnx, b'some content').eid
_ = create_image(cnx, b'some content').eid
cnx.commit()
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment