Beispiel #1
0
    def setUp(self):
        config = ConnectionConfiguration.objects.create(name='my_name', connection_type='django.db.backends.sqlite3',
                                                        info='"name": "test-data/test_site.sqlite3"')

        # get connection
        manager = ConnectionManager(config.info_to_json())
        self.connection = manager.get(config.name)

        super(UserTableSelectionFormTests, self).setUp()
Beispiel #2
0
 def get_connection(self):
     manager = ConnectionManager(self.info_to_json())
     return manager.get(self.name)
Beispiel #3
0
    def test_exception_connection_not_found(self):
        config = Configuration('test-data/config/sqlite3_config.json')
        cm = ConnectionManager(config.get_connection_info())

        with self.assertRaises(ConnectionNotFound):
            cm.get('wrong_db')
Beispiel #4
0
    def test_exception_connection_not_found(self):
        config = Configuration('test-data/config/sqlite3_config.json')
        cm = ConnectionManager(config.get_connection_info())

        with self.assertRaises(ConnectionNotFound):
            cm.get('wrong_db')
Beispiel #5
0
 def get_connection(self):
     manager = ConnectionManager(self.info_to_json())
     return manager.get(self.name)