Exemplo n.º 1
0
class GetDjangoModelTest(TestCase):
    def setUp(self):
        modeldata = {
            'code': 'test Code',
            'description': 'test Description',
            'dbEngine': 'test dbEngine',
            'dbName': 'test dbName',
            'dbUser': '******',
            'dbPassword': '******',
            'dbHost': 'test dbHost',
            'dbPort': 'test dbPort'
        }
        self.testProject = Project(**modeldata)
        self.testProject.save()

    def tearDown(self):
        pass

    def test_method_with_no_dot_in_name(self):
        returnMessage = getDjangoModel('Project')
        self.assertTrue(returnMessage is not None)

    def test_method_with_single_dot_in_name(self):
        returnMessage = getDjangoModel('prototype.Project')
        self.assertTrue(returnMessage is not None)

    def test_method_with_two_dots_in_name(self):
        returnMessage = getDjangoModel('prototype.Project.ExtraStuffInName')
        self.assertTrue(returnMessage is not None)

    def test_method_with_user_none(self):
        self.assertRaises(Exception, getDjangoModel, 'SomeInvalidName')
Exemplo n.º 2
0
class GetDjangoModelTest(TestCase):
    def setUp(self):
        modeldata = {
            'code': 'test Code',
            'description': 'test Description',
            'dbEngine': 'test dbEngine',
            'dbName': 'test dbName',
            'dbUser': '******',
            'dbPassword': '******',
            'dbHost': 'test dbHost',
            'dbPort': 'test dbPort'
        }
        self.testProject = Project(**modeldata)
        self.testProject.save()

    def tearDown(self):
        pass

    def test_method_with_no_dot_in_name(self):
        returnMessage = getDjangoModel('Project')
        self.assertTrue(returnMessage is not None)

    def test_method_with_single_dot_in_name(self):
        returnMessage = getDjangoModel('prototype.Project')
        self.assertTrue(returnMessage is not None)

    def test_method_with_two_dots_in_name(self):
        returnMessage = getDjangoModel('prototype.Project.ExtraStuffInName')
        self.assertTrue(returnMessage is not None)

    def test_method_with_user_none(self):
        self.assertRaises(Exception, getDjangoModel, 'SomeInvalidName')
Exemplo n.º 3
0
 def setUp(self):
     modeldata = {
         'code': 'test Code',
         'description': 'test Description',
         'dbEngine': 'test dbEngine',
         'dbName': 'test dbName',
         'dbUser': '******',
         'dbPassword': '******',
         'dbHost': 'test dbHost',
         'dbPort': 'test dbPort'
     }
     self.testProject = Project(**modeldata)
     self.testProject.save()
Exemplo n.º 4
0
def createTestProject():

    projectdata = {
        'code': 'testCode',
        'description': 'Project used for tests',
        'dbEngine': 'MySQL',
        'dbName': 'testDatabase',
        'dbUser': '******',
        'dbPassword': '******',
        'dbHost': 'testlocalhost',
        'dbPort': 'testPort'
    }

    testProject = Project(**projectdata)
    testProject.save()

    return testProject
Exemplo n.º 5
0
 def setUp(self):
     modeldata = {
         'code': 'test Code',
         'description': 'test Description',
         'dbEngine': 'test dbEngine',
         'dbName': 'test dbName',
         'dbUser': '******',
         'dbPassword': '******',
         'dbHost': 'test dbHost',
         'dbPort': 'test dbPort'
     }
     self.testProject = Project(**modeldata)
     self.testProject.save()