예제 #1
0
 def runshell(self):
     from django.db import connection
     conn_string = connection._connect_string(settings)
     args = [self.executable_name, "-L", conn_string]
     if os.name == 'nt':
         sys.exit(os.system(" ".join(args)))
     else:
         os.execvp(self.executable_name, args)
예제 #2
0
 def runshell(self):
     from django.db import connection
     conn_string = connection._connect_string(settings)
     args = [self.executable_name, "-L", conn_string]
     if os.name == 'nt':
         sys.exit(os.system(" ".join(args)))
     else:
         os.execvp(self.executable_name, args)
예제 #3
0
 def test_with_rlwrap(self):
     run_args, run_kwargs = self._run_dbshell(rlwrap=True)
     self.assertEqual(
         run_args,
         ('/usr/bin/rlwrap', 'sqlplus', '-L', connection._connect_string()),
     )
     self.assertEqual(
         run_kwargs,
         {'check': True},
     )
예제 #4
0
 def test_password_with_at_sign(self):
     old_password = connection.settings_dict['PASSWORD']
     connection.settings_dict['PASSWORD'] = '******'
     try:
         self.assertIn('/"p@ssword"@', connection._connect_string())
         with self.assertRaises(DatabaseError) as context:
             connection.cursor()
         # Database exception: "ORA-01017: invalid username/password" is
         # expected.
         self.assertIn('ORA-01017', context.exception.args[0].message)
     finally:
         connection.settings_dict['PASSWORD'] = old_password
예제 #5
0
 def test_with_input(self):
     run_args, run_kwargs = self._run_dbshell(rlwrap=True,
                                              input=b'testdata')
     self.assertEqual(
         run_args,
         ('/usr/bin/rlwrap', 'sqlplus', '-L', connection._connect_string()),
     )
     self.assertEqual(
         run_kwargs,
         {
             'check': True,
             'input': b'testdata'
         },
     )
예제 #6
0
파일: client.py 프로젝트: bleda-xx/django
 def runshell(self):
     from django.db import connection
     conn_string = connection._connect_string(settings)
     args = [self.executable_name, "-L", conn_string]
     os.execvp(self.executable_name, args)
예제 #7
0
 def test_parameters(self):
     self.assertEqual(
         self._run_dbshell(parameters=['-HELP']),
         ['sqlplus', '-L',
          connection._connect_string(), '-HELP'],
     )
예제 #8
0
 def test_with_rlwrap(self):
     self.assertEqual(
         self._run_dbshell(rlwrap=True),
         ['/usr/bin/rlwrap', 'sqlplus', '-L',
          connection._connect_string()],
     )
예제 #9
0
 def test_without_rlwrap(self):
     self.assertEqual(
         self._run_dbshell(rlwrap=False),
         ['sqlplus', '-L', connection._connect_string()],
     )
예제 #10
0
 def runshell(self):
     from django.db import connection
     conn_string = connection._connect_string(settings)
     args = [self.executable_name, "-L", conn_string]
     os.execvp(self.executable_name, args)