@pytest.mark.django_db
def test_get_units(rf, default):
 view = get_units
 request = create_api_request(rf, user=default)
 with pytest.raises(Http400):
  view(request)
 request = create_api_request(rf, url='/?path=foo', user=default)
 with pytest.raises(Http404):
  view(request)

@ pytest . mark . django_db def test_get_units ( rf , default ) : view = get_units request = create_api_request ( rf , user = default ) with pytest . raises ( Http400 ) : view ( request ) request = create_api_request ( rf , url = '/?path=foo' , user = default ) with pytest . raises ( Http404 ) : view ( request )
tests units can be retrieved .