Skip to content

Commit

Permalink
Merge pull request #89 from biocore/dak_articles_update
Browse files Browse the repository at this point in the history
daklapack article changes
  • Loading branch information
wasade authored Apr 6, 2022
2 parents a3ef721 + 7d0ec4a commit 1ba6787
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 29 deletions.
2 changes: 1 addition & 1 deletion microsetta_admin/server.py
Original file line number Diff line number Diff line change
Expand Up @@ -880,7 +880,7 @@ def return_error(msg):
# get required fields; cast where expected by api
phone_number = request.form['contact_phone_number']
project_ids_list = list(map(int, request.form.getlist('projects')))
dak_article_code = int(request.form['dak_article_code'])
dak_article_code = request.form['dak_article_code']
article_quantity = int(request.form['quantity'])
file = request.files['addresses_file']

Expand Down
2 changes: 1 addition & 1 deletion microsetta_admin/templates/submit_daklapack_order.html
Original file line number Diff line number Diff line change
Expand Up @@ -188,7 +188,7 @@ <h3>Submit Daklapack Order</h3>
<select name="dak_article_code" id="dak_article_code">
<option value="">{{ dummy_status }}</option>
{% for dak_article in dak_articles %}
<option value="{{ dak_article.dak_article_code }}">{{ dak_article.short_description }}</option>
<option value="{{ dak_article.dak_article_code }}">{{ dak_article.detailed_description }}</option>
{% endfor %}
</select>
</div>
Expand Down
33 changes: 6 additions & 27 deletions microsetta_admin/tests/test_routes.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

DUMMY_DAK_ORDER = {'contact_phone_number': '(858) 555-1212',
'projects': ['1', '32'],
'dak_article_code': '350101',
'dak_article_code': '3510001E',
'quantity': '2',
'planned_send_date': '',
'description': '',
Expand Down Expand Up @@ -369,20 +369,10 @@ def test_manage_projects_fail(self):

def test_get_submit_daklapack_order_success(self):
# server side issues two GETs to the API
dak_article = {'dak_article_code': 350100,
dak_article = {'dak_article_code': '3510000E',
'short_description': 'TMI 1 tube',
'num_2point5ml_etoh_tubes': 1,
'num_7ml_etoh_tube': 0,
'num_neoteryx_kit': 0,
'outer_sleeve': 'Microsetta',
'box': 'Microsetta',
'return_label': 'Microsetta',
'compartment_bag': 'Microsetta',
'num_stool_collector': 0,
'instructions': 'Fv1',
'registration_card': 'Microsetta',
'swabs': '1x bag of two',
'rigid_safety_bag': 'yes'}
'detailed_description': 'TMI 1 tube, American English'}

a_project = {'project_name': 'test_proj', 'is_microsetta': True,
'bank_samples': False, 'plating_start_date': None,
'contact_name': 'Jane Doe',
Expand Down Expand Up @@ -456,20 +446,9 @@ def test_get_submit_daklapack_order_fail_articles(self):

def test_get_submit_daklapack_order_fail_projects(self):
# server side issues two GETs to the API
dak_article = {'dak_article_code': 350100,
dak_article = {'dak_article_code': '3510000E',
'short_description': 'TMI 1 tube',
'num_2point5ml_etoh_tubes': 1,
'num_7ml_etoh_tube': 0,
'num_neoteryx_kit': 0,
'outer_sleeve': 'Microsetta',
'box': 'Microsetta',
'return_label': 'Microsetta',
'compartment_bag': 'Microsetta',
'num_stool_collector': 0,
'instructions': 'Fv1',
'registration_card': 'Microsetta',
'swabs': '1x bag of two',
'rigid_safety_bag': 'yes'}
'detailed_description': 'TMI 1 tube, American English'}
a_project = {'error_message': 'no projects for you'}

api_get_1 = DummyResponse(200, [dak_article])
Expand Down

0 comments on commit 1ba6787

Please sign in to comment.