Skip to content

Commit

Permalink
test
Browse files Browse the repository at this point in the history
  • Loading branch information
rbi-aap committed Aug 6, 2024
1 parent 7200041 commit 706d14d
Showing 1 changed file with 37 additions and 37 deletions.
74 changes: 37 additions & 37 deletions tests/test_wire.py
Original file line number Diff line number Diff line change
Expand Up @@ -91,43 +91,43 @@ def test_bookmarks(client, app):
assert 0 == get_bookmarks_count(client, user_id)


# def test_bookmarks_by_section(client, app):
# products = [
# {
# "_id": 1,
# "name": "Service A",
# "query": "service.code: a",
# "is_enabled": True,
# "description": "Service A",
# "companies": ['1'],
# "sd_product_id": None,
# "product_type": "wire"
# }
# ]
#
# app.data.insert('products', products)
# product_id = app.data.find_all('products')[0]['_id']
# assert product_id == 1
#
# with client.session_transaction() as session:
# session['user'] = '59b4c5c61d41c8d736852fbf'
# session['user_type'] = 'public'
#
# assert 0 == get_bookmarks_count(client, PUBLIC_USER_ID)
#
# resp = client.post('/wire_bookmark', data=json.dumps({
# 'items': [items[0]['_id']],
# }), content_type='application/json')
# assert resp.status_code == 200
#
# assert 1 == get_bookmarks_count(client, PUBLIC_USER_ID)
#
# client.delete('/wire_bookmark', data=json.dumps({
# 'items': [items[0]['_id']],
# }), content_type='application/json')
# assert resp.status_code == 200
#
# assert 0 == get_bookmarks_count(client, PUBLIC_USER_ID)
def test_bookmarks_by_section(client, app):
products = [
{
"_id": 1,
"name": "Service A",
"query": "service.code: a",
"is_enabled": True,
"description": "Service A",
"companies": ['1'],
"sd_product_id": None,
"product_type": "wire"
}
]

app.data.insert('products', products)
product_id = app.data.find_all('products')[0]['_id']
assert product_id == 1

with client.session_transaction() as session:
session['user'] = '59b4c5c61d41c8d736852fbf'
session['user_type'] = 'public'

assert 0 == get_bookmarks_count(client, PUBLIC_USER_ID)

resp = client.post('/wire_bookmark', data=json.dumps({
'items': [items[0]['_id']],
}), content_type='application/json')
assert resp.status_code == 200

assert 1 == get_bookmarks_count(client, PUBLIC_USER_ID)

client.delete('/wire_bookmark', data=json.dumps({
'items': [items[0]['_id']],
}), content_type='application/json')
assert resp.status_code == 200

assert 0 == get_bookmarks_count(client, PUBLIC_USER_ID)


def test_item_copy(client, app):
Expand Down

0 comments on commit 706d14d

Please sign in to comment.