dehnert/ESP-Website — comment on commit 5610a3190261b3a3be7c0fda42b4e94d22d4bc40
File: esp/esp/utils/migrations/0002_migrate_templates_to_reversion.py line 8
By pteromys:

I'd change this line to `import esp.utils.admin`; the `import utils.admin` shorthand should be used only in the interactive shell.

Part of the reason is that Django can't tell that esp.utils.admin and utils.admin are the same module. This becomes relevant for some of its import voodoo that tries to ensure certain pieces of code run only once. In particular, if the /admin app sees TemplateOverride being registered once from utils.admin and once from esp.utils.admin, it'll throw an AlreadyRegistered. This shows up in the tests, since the test runner has to import the migrations in order to set up the database, and then the rest of the site in order to run the tests.