Skipping hidden tests with references and tolerances causes exception

Issue #439 resolved
Randle Taylor created an issue

Currently hidden tests can not have new references/tolerances set because they are hidden from the “Set References and Tolerances” page in the admin. However, if a test has a reference/tolerance set and is subsequently hidden, then when a user skips that test while performing a test list (by filtering out its category) than an exception is thrown:

TypeError: unsupported operand type(s) for -: 'NoneType' and 'float'
  File "django/core/handlers/exception.py", line 34, in inner
    response = get_response(request)
  File "django/core/handlers/base.py", line 126, in _get_response
    response = self.process_exception_by_middleware(e, request)
  File "django/core/handlers/base.py", line 124, in _get_response
    response = wrapped_callback(request, *callback_args, **callback_kwargs)
  File "django/views/generic/base.py", line 68, in view
    return self.dispatch(request, *args, **kwargs)
  File "braces/views/_access.py", line 211, in dispatch
    request, *args, **kwargs)
  File "django/views/generic/base.py", line 88, in dispatch
    return handler(request, *args, **kwargs)
  File "django/views/generic/edit.py", line 194, in post
    return super().post(request, *args, **kwargs)
  File "django/views/generic/edit.py", line 142, in post
    return self.form_valid(form)
  File "qatrack/qa/views/perform.py", line 1204, in form_valid
    self.update_test_instance(ti)
  File "qatrack/qa/views/perform.py", line 1310, in update_test_instance
    ti.calculate_pass_fail()
  File "qatrack/qa/models.py", line 1848, in calculate_pass_fail
    self.float_pass_fail()
  File "qatrack/qa/models.py", line 1805, in float_pass_fail
    diff = self.calculate_diff()
  File "qatrack/qa/models.py", line 1831, in calculate_diff
    diff = self.difference()
  File "qatrack/qa/models.py", line 1775, in difference
    return self.value - self.reference.value

Comments (1)

  1. Log in to comment