예제 #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
파일: tests.py 프로젝트: BangC/django-mssql
    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()