示例#1
0
    def test_connection_error(self):
        """
        Attempt an invalid connection and check the error for a password.
        """
        from django.conf import settings

        databases = {}
        databases.update(settings.DATABASES['default'])
        databases['USER'] = '******'
        databases['PASSWORD'] = '******'

        connection_string = base.make_connection_string(databases)

        with self.assertRaises(dbapi.OperationalError) as err:
            dbapi.connect(connection_string)
        self.assertNotIn('PWD=myPass;', str(err.exception))
        self.assertIn('PWD=******;', str(err.exception))
示例#2
0
    def test_connection_error(self):
        """
        Attempt an invalid connection and check the error for a password.
        """
        from django.conf import settings

        databases = {}
        databases.update(settings.DATABASES['default'])
        databases['USER'] = '******'
        databases['PASSWORD'] = '******'

        connection_string = base.make_connection_string(databases)

        with self.assertRaises(dbapi.OperationalError) as err:
            dbapi.connect(connection_string)
        self.assertNotIn('PWD=myPass;', str(err.exception))
        self.assertIn('PWD=******;', str(err.exception))
示例#3
0
def main():
    connection = db.connect("PROVIDER=SQLOLEDB;DATA SOURCE=localhost\\ss2005;Initial Catalog=Ted;Integrated Security=SSPI")
    sproc_2b(connection)
    connection.close()
示例#4
0
def main():
    connection = db.connect("PROVIDER=SQLOLEDB;DATA SOURCE=localhost\\ss2005;Initial Catalog=Ted;Integrated Security=SSPI")
    sproc_2b(connection)
    connection.close()