File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -133,8 +133,8 @@ def autodiscover():
133133 may want.
134134 """
135135
136+ from importlib import import_module
136137 from django .conf import settings
137- from django .utils .importlib import import_module
138138 from django .utils .module_loading import module_has_submodule
139139
140140 for app in settings .INSTALLED_APPS :
Original file line number Diff line number Diff line change 11import os
22import sys
33import json
4+ from importlib import import_module
45
6+ from django .apps import apps
57from django .test import Client
68from django .conf import settings
7- from django .utils .importlib import import_module
8- from django .db import models
99
1010from tastypie .exceptions import BadRequest
1111from tastypie .test import ResourceTestCaseMixin
@@ -82,7 +82,8 @@ def test_all_model_resources_exist(self):
8282 self .assertValidJSONResponse (r )
8383 app_resources = json .loads (r .content )
8484 self ._assertCallbackReturnsSameJSON ("/api/v1/%s/" % name , app_resources )
85- model_list = models .get_models (app .models )
85+ #
86+ model_list = apps .get_app_config (name ).get_models ()
8687 for model in model_list :
8788 if not model ._meta .model_name in app_resources .keys ():
8889 #print("There doesn't seem to be any resource for model %s.models.%s"%(app.__name__,model.__name__,))
You can’t perform that action at this time.
0 commit comments