Kaydet (Commit) cfbdd587 authored tarafından Aymeric Augustin's avatar Aymeric Augustin

Added file forgotten in previous commit, plus one more test.

üst e179291f
from __future__ import unicode_literals
from django.apps import AppConfig
class MyAdmin(AppConfig):
name = 'django.contrib.admin'
verbose_name = "Admin sweet admin."
class MyAuth(AppConfig):
name = 'django.contrib.auth'
verbose_name = "All your password are belong to us."
class BadConfig(AppConfig):
"""This class doesn't supply the mandatory 'name' attribute."""
class NotAConfig(object):
name = 'apps'
class NoSuchApp(AppConfig):
name = 'there is no such app'
...@@ -73,8 +73,12 @@ class AppsTests(TestCase): ...@@ -73,8 +73,12 @@ class AppsTests(TestCase):
def test_no_such_app(self): def test_no_such_app(self):
""" """
Tests when INSTALLED_APPS contains an app config for an app that doesn't exist. Tests when INSTALLED_APPS contains an app that doesn't exist, either
directly or via an app config.
""" """
with self.assertRaises(ImportError):
with self.settings(INSTALLED_APPS=['there is no such app']):
pass
with self.assertRaises(ImportError): with self.assertRaises(ImportError):
with self.settings(INSTALLED_APPS=['apps.apps.NoSuchApp']): with self.settings(INSTALLED_APPS=['apps.apps.NoSuchApp']):
pass pass
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment