Skip to content
Snippets Groups Projects
Commit a109b634 authored by Sascha Herzinger's avatar Sascha Herzinger
Browse files

Made data_ids in session unique

parent 8dda994f
No related branches found
No related tags found
No related merge requests found
Pipeline #
......@@ -31,6 +31,7 @@ def create_data():
auth=payload['auth'])
data_ids = etl_handler.handle(descriptors=payload['descriptors'], wait=wait)
session['data_ids'] += data_ids
session['data_ids'] = list(set(session['data_ids'])) # make unique
return jsonify({'data_ids': data_ids}), 201
......
......@@ -401,4 +401,10 @@ class TestData:
]
)
with pytest.raises(NotImplementedError):
test_client.post('/data', data=flask.json.dumps(data))
\ No newline at end of file
test_client.post('/data', data=flask.json.dumps(data))
def test_session_data_ids_should_be_unique(self, test_client, small_post):
small_post(random=False)
small_post(random=False)
with test_client.session_transaction() as sess:
assert len(sess['data_ids']) == 1
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment