File tree Expand file tree Collapse file tree 3 files changed +7
-10
lines changed Expand file tree Collapse file tree 3 files changed +7
-10
lines changed Original file line number Diff line number Diff line change @@ -130,7 +130,6 @@ def _decode(self, param):
130130 CONVERT_TYPES = (datetime .datetime , datetime .date , datetime .time )
131131 return force_str (param , strings_only = not isinstance (param , CONVERT_TYPES ))
132132
133-
134133 def _last_executed_query (self , sql , params ):
135134 """Get the last executed query from the connection."""
136135 # Django's psycopg3 backend creates a new cursor in its implementation of the
Original file line number Diff line number Diff line change 22
33
44def force_str (s , * args , ** kwargs ):
5- '''
5+ """
66 Forces values to strings.
77 Will return "Django Debug Toolbar was unable to parse value." when there's a decoding error.
8- '''
8+ """
99 try :
1010 return force_string (s , * args , ** kwargs )
1111 except DjangoUnicodeDecodeError :
Original file line number Diff line number Diff line change @@ -7,14 +7,12 @@ class ForceStrTestCase(unittest.TestCase):
77 def test_success_convert (self ):
88 input = 0
99
10- self .assertEqual (
11- force_str (input ),
12- "0"
13- )
10+ self .assertEqual (force_str (input ), "0" )
1411
1512 def test_failed_convert (self ):
16- input = bytes .fromhex ("a3f2b8c14e972d5a8fb3c7291a64e0859c472bf63d18a0945e73b2c84f917ae2" )
13+ input = bytes .fromhex (
14+ "a3f2b8c14e972d5a8fb3c7291a64e0859c472bf63d18a0945e73b2c84f917ae2"
15+ )
1716 self .assertEqual (
18- force_str (input ),
19- "Django Debug Toolbar was unable to parse value."
17+ force_str (input ), "Django Debug Toolbar was unable to parse value."
2018 )
You can’t perform that action at this time.
0 commit comments