from django.test import TestCase from django.test.utils import override_settings from pingcap_sso.discourse.models import DiscourseUser @override_settings( SMS_BACKEND='sms.backends.dummy.SmsBackend', TRUSTED_HOSTS=['tidb.io'], # Just for disable django-rest-framework's throttle CACHES={ 'default': { 'BACKEND': 'django.core.cache.backends.dummy.DummyCache', } }, ) class ExampleTest(TestCase): databases = ['default', 'discourse'] def test_time(self): print(DiscourseUser.objects.all())