Changeset 2387
- Timestamp:
- 02/24/06 22:46:06 (3 years ago)
- Files:
-
- django/branches/magic-removal/django/core/management.py (modified) (4 diffs)
- django/branches/magic-removal/tests/runtests.py (modified) (5 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
django/branches/magic-removal/django/core/management.py
r2386 r2387 298 298 299 299 app_models = get_models(app) 300 app_label = app_models[0]._meta.app_label301 output.append(_get_packages_insert(app_label))302 300 app_dir = os.path.normpath(os.path.join(os.path.dirname(app.__file__), 'sql')) 303 301 … … 306 304 307 305 # Add custom SQL, if it's available. 308 # FIXME: This probably needs changing306 # TODO: This probably needs changing 309 307 sql_files = [os.path.join(app_dir, opts.module_name + '.' + settings.DATABASE_ENGINE + '.sql'), 310 308 os.path.join(app_dir, opts.module_name + '.sql')] … … 315 313 fp.close() 316 314 317 # Content types. 318 output.append(_get_contenttype_insert(opts)) 319 # Permissions. 320 for codename, name in _get_all_permissions(opts): 321 output.append(_get_permission_insert(name, codename, opts)) 315 # TODO: This is temporarily commented out until we come up 316 # with a better way of letting people initialize content types and 317 # permissions. 318 # # Content types. 319 # output.append(_get_contenttype_insert(opts)) 320 # # Permissions. 321 # for codename, name in _get_all_permissions(opts): 322 # output.append(_get_permission_insert(name, codename, opts)) 322 323 return output 323 324 get_sql_initial_data.help_doc = "Prints the initial INSERT SQL statements for the given app name(s)." … … 1165 1166 elif action == 'shell': 1166 1167 action_mapping[action](options.plain is True) 1167 elif action in ('init', ' init-minimal', 'validate'):1168 elif action in ('init', 'validate'): 1168 1169 action_mapping[action]() 1169 1170 elif action == 'inspectdb': django/branches/magic-removal/tests/runtests.py
r2339 r2387 90 90 else: 91 91 run_othertests = not self.which_tests 92 92 93 93 if self.which_tests: 94 94 # Only run the specified tests. … … 134 134 # Initialize the test database. 135 135 cursor = connection.cursor() 136 self.output(1, "Initializing test database")137 management.init_minimal()138 136 139 137 # Run the tests for each test model. … … 147 145 log_error(model_name, "Error while importing", ''.join(traceback.format_exception(*sys.exc_info())[1:])) 148 146 continue 149 147 150 148 if not getattr(mod, 'error_log', None): 151 149 # Model is not marked as an invalid model … … 163 161 self.output(1, "%s model: Running tests" % model_name) 164 162 runner.run(dtest, clear_globs=True, out=sys.stdout.write) 165 else: 163 else: 166 164 # Check that model known to be invalid is invalid for the right reasons. 167 165 self.output(1, "%s model: Validating" % model_name) 168 166 169 167 from cStringIO import StringIO 170 168 s = StringIO() … … 174 172 actual = error_log.split('\n') 175 173 expected = mod.error_log.split('\n') 176 177 unexpected = [err for err in actual if err not in expected] 174 175 unexpected = [err for err in actual if err not in expected] 178 176 missing = [err for err in expected if err not in actual] 179 177 180 178 if unexpected or missing: 181 179 unexpected_log = '\n'.join(unexpected)
