Exemplo n.º 1
0
 def test_it_returns_the_model_if_found(self):
     from tests.models import TestPerson
     result = ModelFinder.find('tests', 'TestPerson')
     self.assertEqual(result, TestPerson)
Exemplo n.º 2
0
 def test_find_raises_error_if_model_name_is_blank(self):
     with self.assertRaises(CommandError):
         ModelFinder.find('nsync', '')
Exemplo n.º 3
0
 def test_it_raises_an_error_if_the_model_cannot_be_found(self):
     with self.assertRaises(LookupError):
         ModelFinder.find('fakeApp', 'missingModel')
Exemplo n.º 4
0
 def test_find_raises_error_if_app_label_is_blank(self):
     with self.assertRaises(CommandError):
         ModelFinder.find('', 'model')
Exemplo n.º 5
0
 def test_it_returns_the_model_if_found(self):
     from tests.models import TestPerson
     result = ModelFinder.find('tests', 'TestPerson')
     self.assertEqual(result, TestPerson)
Exemplo n.º 6
0
 def test_it_raises_an_error_if_the_model_cannot_be_found(self):
     with self.assertRaises(LookupError):
         ModelFinder.find('fakeApp', 'missingModel')
Exemplo n.º 7
0
 def test_find_raises_error_if_model_name_is_blank(self):
     with self.assertRaises(CommandError):
         ModelFinder.find('nsync', '')
Exemplo n.º 8
0
 def test_find_raises_error_if_app_label_is_blank(self):
     with self.assertRaises(CommandError):
         ModelFinder.find('', 'model')