Ticket #10706: t10706.diff
File t10706.diff, 6.0 KB (added by , 15 years ago) |
---|
-
tests/regressiontests/admin_scripts/tests.py
337 337 args = ['sqlall','--settings=settings', 'admin_scripts'] 338 338 out, err = self.run_django_admin(args) 339 339 self.assertNoOutput(out) 340 self.assertOutput(err, 'App with label admin_scripts could not be found ')340 self.assertOutput(err, 'App with label admin_scripts could not be found or caused an error during import') 341 341 342 342 def test_builtin_with_environment(self): 343 343 "minimal: django-admin builtin commands fail if settings are provided in the environment" 344 344 args = ['sqlall','admin_scripts'] 345 345 out, err = self.run_django_admin(args,'settings') 346 346 self.assertNoOutput(out) 347 self.assertOutput(err, 'App with label admin_scripts could not be found ')347 self.assertOutput(err, 'App with label admin_scripts could not be found or caused an error during import') 348 348 349 349 def test_builtin_with_bad_settings(self): 350 350 "minimal: django-admin builtin commands fail if settings file (from argument) doesn't exist" … … 760 760 args = ['sqlall','admin_scripts'] 761 761 out, err = self.run_manage(args) 762 762 self.assertNoOutput(out) 763 self.assertOutput(err, 'App with label admin_scripts could not be found ')763 self.assertOutput(err, 'App with label admin_scripts could not be found or caused an error during import') 764 764 765 765 def test_builtin_with_settings(self): 766 766 "minimal: manage.py builtin commands fail if settings are provided as argument" 767 767 args = ['sqlall','--settings=settings', 'admin_scripts'] 768 768 out, err = self.run_manage(args) 769 769 self.assertNoOutput(out) 770 self.assertOutput(err, 'App with label admin_scripts could not be found ')770 self.assertOutput(err, 'App with label admin_scripts could not be found or caused an error during import') 771 771 772 772 def test_builtin_with_environment(self): 773 773 "minimal: manage.py builtin commands fail if settings are provided in the environment" 774 774 args = ['sqlall','admin_scripts'] 775 775 out, err = self.run_manage(args,'settings') 776 776 self.assertNoOutput(out) 777 self.assertOutput(err, 'App with label admin_scripts could not be found ')777 self.assertOutput(err, 'App with label admin_scripts could not be found or caused an error during import') 778 778 779 779 def test_builtin_with_bad_settings(self): 780 780 "minimal: manage.py builtin commands fail if settings file (from argument) doesn't exist" … … 788 788 args = ['sqlall','admin_scripts'] 789 789 out, err = self.run_manage(args,'bad_settings') 790 790 self.assertNoOutput(out) 791 self.assertOutput(err, 'App with label admin_scripts could not be found ')791 self.assertOutput(err, 'App with label admin_scripts could not be found or caused an error during import') 792 792 793 793 def test_custom_command(self): 794 794 "minimal: manage.py can't execute user commands without appropriate settings" … … 897 897 args = ['sqlall','admin_scripts'] 898 898 out, err = self.run_manage(args) 899 899 self.assertNoOutput(out) 900 self.assertOutput(err, 'App with label admin_scripts could not be found .')900 self.assertOutput(err, 'App with label admin_scripts could not be found or caused an error during import.') 901 901 902 902 def test_builtin_with_settings(self): 903 903 "multiple: manage.py builtin commands succeed if settings are provided as argument" … … 912 912 args = ['sqlall','admin_scripts'] 913 913 out, err = self.run_manage(args,'alternate_settings') 914 914 self.assertNoOutput(out) 915 self.assertOutput(err, 'App with label admin_scripts could not be found .')915 self.assertOutput(err, 'App with label admin_scripts could not be found or caused an error during import.') 916 916 917 917 def test_builtin_with_bad_settings(self): 918 918 "multiple: manage.py builtin commands fail if settings file (from argument) doesn't exist" … … 926 926 args = ['sqlall','admin_scripts'] 927 927 out, err = self.run_manage(args,'bad_settings') 928 928 self.assertNoOutput(out) 929 self.assertOutput(err, "App with label admin_scripts could not be found ")929 self.assertOutput(err, "App with label admin_scripts could not be found or caused an error during import") 930 930 931 931 def test_custom_command(self): 932 932 "multiple: manage.py can't execute user commands using default settings" … … 1067 1067 "User AppCommands can execute when a single app name is provided" 1068 1068 args = ['app_command', 'NOT_AN_APP'] 1069 1069 out, err = self.run_manage(args) 1070 self.assertOutput(err, "App with label NOT_AN_APP could not be found ")1070 self.assertOutput(err, "App with label NOT_AN_APP could not be found or caused an error during import") 1071 1071 1072 1072 def test_app_command_some_invalid_appnames(self): 1073 1073 "User AppCommands can execute when some of the provided app names are invalid" 1074 1074 args = ['app_command', 'auth', 'NOT_AN_APP'] 1075 1075 out, err = self.run_manage(args) 1076 self.assertOutput(err, "App with label NOT_AN_APP could not be found ")1076 self.assertOutput(err, "App with label NOT_AN_APP could not be found or caused an error during import") 1077 1077 1078 1078 def test_label_command(self): 1079 1079 "User LabelCommands can execute when a label is provided" -
django/db/models/loading.py
122 122 return None 123 123 else: 124 124 return mod 125 raise ImproperlyConfigured, "App with label %s could not be found " % app_label125 raise ImproperlyConfigured, "App with label %s could not be found or caused an error during import" % app_label 126 126 finally: 127 127 self.write_lock.release() 128 128