django test, app aren't loaded yet

django.core.exceptions.AppRegistryNotReady: Apps aren't loaded yet.

解决方法: 用django的TestCase

from django.test import TestCase

or 

import django
django.setup()

 or

In [9]: from django.conf import settings

In [10]: settings.configure()

In [11]: import django

In [12]: django.setup()
原文地址:https://www.cnblogs.com/buxizhizhoum/p/13667870.html