def test_verify_ID(self): # DONE """ **test_verify_ID** Function mocks the var 'item_id' **then runs verify_id to see if it returns correct boolean values for equal input and unequal input """ s_val = "123" f_val = "234" success = models.verify_id(s_val) failure = models.verify_id(f_val) assert success # verify_id did not return true when input and item_id were equal" assert not failure # verify_id did not return false when input and item_id were different"
def render_result(request): """ :param: HttpRequest :rtype: HttpResponse Based on the user input it either redirects to render_correct(), render_incorrect(), or render_congrats """ if request.method == "POST": usr_input_value = str(request.POST.get("input", "")) if verify_id(usr_input_value) == True: global TEMP if len(TEMP) == 0: return redirect("rend_congrats") else: return redirect("rend_correct") else: return redirect("rend_incorrect")