← Back to team overview

yahoo-eng-team team mailing list archive

[Bug 1789046] Re: unit test cannot be started under Django 2.1

 

I believe this has been addressed when we support Django 2.2.

** Changed in: horizon
       Status: In Progress => Fix Released

-- 
You received this bug notification because you are a member of Yahoo!
Engineering Team, which is subscribed to OpenStack Dashboard (Horizon).
https://bugs.launchpad.net/bugs/1789046

Title:
  unit test cannot be started under Django 2.1

Status in OpenStack Dashboard (Horizon):
  Fix Released

Bug description:
  Hi,

  Building Horizon in Debian Stretch is no problem, and all unit test
  pass. Unfortunately, under Python 3.7 in Debian Sid, it doesn't even
  start to run unit tests:

  + http_proxy=127.0.0.1:9 https_proxy=127.0.0.9:9 HTTP_PROXY=127.0.0.1:9 HTTPS_PROXY=127.0.0.1:9 PYTHONPATH=/<<PKGBUILDDIR>>/debian/tmp/usr/lib/python3/dist-packages PYTHON=python3.7 python3.7 -m coverage run /<<PKGBUILDDIR>>/manage.py test -v 2 --settings=horizon.test.settings horizon/test/unit
  /usr/lib/python3/dist-packages/scss/selector.py:54: FutureWarning: Possible nested set at position 329
    ''', re.VERBOSE | re.MULTILINE)
  /usr/lib/python3/dist-packages/pep8.py:110: FutureWarning: Possible nested set at position 1
    EXTRANEOUS_WHITESPACE_REGEX = re.compile(r'[[({] | []}),;:]')
  Traceback (most recent call last):
    File "/<<PKGBUILDDIR>>/manage.py", line 25, in <module>
      execute_from_command_line(sys.argv)
    File "/usr/lib/python3/dist-packages/django/core/management/__init__.py", line 381, in execute_from_command_line
      utility.execute()
    File "/usr/lib/python3/dist-packages/django/core/management/__init__.py", line 375, in execute
      self.fetch_command(subcommand).run_from_argv(self.argv)
    File "/usr/lib/python3/dist-packages/django/core/management/commands/test.py", line 26, in run_from_argv
      super().run_from_argv(argv)
    File "/usr/lib/python3/dist-packages/django/core/management/base.py", line 316, in run_from_argv
      self.execute(*args, **cmd_options)
    File "/usr/lib/python3/dist-packages/django/core/management/base.py", line 353, in execute
      output = self.handle(*args, **options)
    File "/usr/lib/python3/dist-packages/django/core/management/commands/test.py", line 56, in handle
      failures = test_runner.run_tests(test_labels)
    File "/usr/lib/python3/dist-packages/django/test/runner.py", line 605, in run_tests
      self.run_checks()
    File "/usr/lib/python3/dist-packages/django/test/runner.py", line 567, in run_checks
      call_command('check', verbosity=self.verbosity)
    File "/usr/lib/python3/dist-packages/django/core/management/__init__.py", line 148, in call_command
      return command.execute(*args, **defaults)
    File "/usr/lib/python3/dist-packages/django/core/management/base.py", line 353, in execute
      output = self.handle(*args, **options)
    File "/usr/lib/python3/dist-packages/django/core/management/commands/check.py", line 65, in handle
      fail_level=getattr(checks, options['fail_level']),
    File "/usr/lib/python3/dist-packages/django/core/management/base.py", line 379, in check
      include_deployment_checks=include_deployment_checks,
    File "/usr/lib/python3/dist-packages/django/core/management/base.py", line 366, in _run_checks
      return checks.run_checks(**kwargs)
    File "/usr/lib/python3/dist-packages/django/core/checks/registry.py", line 71, in run_checks
      new_errors = check(app_configs=app_configs)
    File "/usr/lib/python3/dist-packages/django/core/checks/urls.py", line 13, in check_url_config
      return check_resolver(resolver)
    File "/usr/lib/python3/dist-packages/django/core/checks/urls.py", line 23, in check_resolver
      return check_method()
    File "/usr/lib/python3/dist-packages/django/urls/resolvers.py", line 396, in check
      for pattern in self.url_patterns:
    File "/usr/lib/python3/dist-packages/django/utils/functional.py", line 37, in __get__
      res = instance.__dict__[self.name] = self.func(instance)
    File "/usr/lib/python3/dist-packages/django/urls/resolvers.py", line 533, in url_patterns
      patterns = getattr(self.urlconf_module, "urlpatterns", self.urlconf_module)
    File "/usr/lib/python3/dist-packages/django/utils/functional.py", line 37, in __get__
      res = instance.__dict__[self.name] = self.func(instance)
    File "/usr/lib/python3/dist-packages/django/urls/resolvers.py", line 526, in urlconf_module
      return import_module(self.urlconf_name)
    File "/usr/lib/python3.7/importlib/__init__.py", line 127, in import_module
      return _bootstrap._gcd_import(name[level:], package, level)
    File "<frozen importlib._bootstrap>", line 1006, in _gcd_import
    File "<frozen importlib._bootstrap>", line 983, in _find_and_load
    File "<frozen importlib._bootstrap>", line 967, in _find_and_load_unlocked
    File "<frozen importlib._bootstrap>", line 677, in _load_unlocked
    File "<frozen importlib._bootstrap_external>", line 728, in exec_module
    File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed
    File "/<<PKGBUILDDIR>>/horizon/test/urls.py", line 36, in <module>
      url(r"auth/login/", views.login, {'template_name': "auth/login.html"},
  AttributeError: module 'django.contrib.auth.views' has no attribute 'login'
  Creating test database for alias 'default' ('file:memorydb_default?mode=memory&cache=shared')...

  Could someone from the Horizon team help me to find the solution? I
  need this to be fixed in order to have Horizon for Debian Buster.

To manage notifications about this bug go to:
https://bugs.launchpad.net/horizon/+bug/1789046/+subscriptions


References