Opened 9 years ago

Last modified 9 years ago

#24618 closed Bug

Incorrect duplicate app message shown when no duplicates found — at Version 1

Reported by: Ross Crawford-d'Heureuse Owned by: nobody
Component: Testing framework Version: 1.7
Severity: Normal Keywords:
Cc: Triage Stage: Unreviewed
Has patch: yes Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no

Description (last modified by Tim Graham)

https://github.com/django/django/pull/4476

Details of this bug are in the ticket but over view is

I have an app with construct: project_name.apps.core

Consistently got: when running tests

django.core.exceptions.ImproperlyConfigured: Application labels aren't unique, duplicates: core

Despite absolutely no chance of it being duplicate;

print of apps form within registry.py

('project_name.apps.v2_api', 'project_name.apps.v1_api', 'project_name.apps.applications', 'project_name.apps.backend', 'project_name.apps.core', 'project_name.apps.tools', 'project_name.apps.me', 'project_name.apps.brand', 'project_name.apps.workorder', 'project_name.apps.batch', 'project_name.apps.printer', 'project_name.apps.scan', 'project_name.apps.code', 'project_name.apps.dash', 'project_name.apps.role_permission')

Considered it being a conflict with django.core (but seems not to be the case)

Am using a custom test runner

class AppTestRunner(DiscoverRunner):
    def build_suite(self, test_labels, *args, **kwargs):
        # not args passed in
        if not test_labels:
            test_labels = settings.PROJECT_APPS

        return super(AppTestRunner, self).build_suite(test_labels, *args, **kwargs)

As you can see the runner runs test tests from ONLY the project and not the dango/helper app test cases

I noticed there has been a very recent refactor (march) of the registry; which is what prompted the investigation as I have had a 1.7 merge branch for this project for some time and the tests have always run with no issue. I recently re installed django (1, 7, 5, 'final', 0) and this error started happening.

I hope the fix makes sense.

Change History (1)

comment:1 by Tim Graham, 9 years ago

Description: modified (diff)
Note: See TracTickets for help on using tickets.
Back to Top