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/", line 34, in inner
    response = get_response(request)
  File "django/core/handlers/", line 126, in _get_response
    response = self.process_exception_by_middleware(e, request)
  File "django/core/handlers/", line 124, in _get_response
    response = wrapped_callback(request, *callback_args, **callback_kwargs)
  File "django/views/generic/", line 68, in view
    return self.dispatch(request, *args, **kwargs)
  File "braces/views/", line 211, in dispatch
    request, *args, **kwargs)
  File "django/views/generic/", line 88, in dispatch
    return handler(request, *args, **kwargs)
  File "django/views/generic/", line 194, in post
    return super().post(request, *args, **kwargs)
  File "django/views/generic/", line 142, in post
    return self.form_valid(form)
  File "qatrack/qa/views/", line 1204, in form_valid
  File "qatrack/qa/views/", line 1310, in update_test_instance
  File "qatrack/qa/", line 1848, in calculate_pass_fail
  File "qatrack/qa/", line 1805, in float_pass_fail
    diff = self.calculate_diff()
  File "qatrack/qa/", line 1831, in calculate_diff
    diff = self.difference()
  File "qatrack/qa/", line 1775, in difference
    return self.value - self.reference.value

Comments (1)

  1. Log in to comment