128 | | try: |
129 | | # if the model was named on the command line, or |
130 | | # no models were named (i.e., run all), import |
131 | | # this model and add it to the list to test. |
132 | | if not test_labels or model_name in set([label.split('.')[0] for label in test_labels]): |
133 | | if verbosity >= 1: |
134 | | print "Importing model %s" % model_name |
135 | | mod = load_app(model_label) |
136 | | if mod: |
137 | | if model_label not in settings.INSTALLED_APPS: |
138 | | settings.INSTALLED_APPS.append(model_label) |
139 | | except Exception, e: |
140 | | sys.stderr.write("Error while importing %s:" % model_name + ''.join(traceback.format_exception(*sys.exc_info())[1:])) |
141 | | continue |
| 128 | # if the model was named on the command line, or |
| 129 | # no models were named (i.e., run all), import |
| 130 | # this model and add it to the list to test. |
| 131 | if not test_labels or model_name in set([label.split('.')[0] for label in test_labels]): |
| 132 | if verbosity >= 1: |
| 133 | print "Importing model %s" % model_name |
| 134 | mod = load_app(model_label) |
| 135 | if mod: |
| 136 | if model_label not in settings.INSTALLED_APPS: |
| 137 | settings.INSTALLED_APPS.append(model_label) |