5
5
from functools import partial
6
6
from json import dumps as json_dump
7
7
from random import shuffle
8
+ from urllib .parse import quote
8
9
from xml .etree .ElementTree import tostring as html_tostring
9
10
10
11
from django .conf import settings
11
12
from django .contrib .contenttypes .models import ContentType
12
13
from django .db .models import Q
13
14
from django .test .utils import override_settings
14
15
from django .urls import reverse
15
- from django .utils .encoding import force_text
16
- from django .utils .http import urlquote
16
+ from django .utils .encoding import force_str # force_text
17
+ # from django.utils.http import urlquote
17
18
from django .utils .timezone import now
18
19
from django .utils .translation import gettext as _
19
20
from django .utils .translation import pgettext
@@ -429,7 +430,8 @@ def post(selection):
429
430
self .assertInHTML (
430
431
f'<input class="lv-state-field" value="{ selection } " '
431
432
f'name="selection" type="hidden" />' ,
432
- force_text (response .content ),
433
+ # force_text(response.content),
434
+ force_str (response .content ),
433
435
)
434
436
435
437
post ('none' )
@@ -450,7 +452,8 @@ def get(selection):
450
452
self .assertInHTML (
451
453
f'<input class="lv-state-field" value="{ selection } " '
452
454
f'name="selection" type="hidden" />' ,
453
- force_text (response .content ),
455
+ # force_text(response.content),
456
+ force_str (response .content ),
454
457
)
455
458
456
459
get ('none' )
@@ -1003,7 +1006,8 @@ def test_ordering_fastmode_01(self):
1003
1006
r'.creme_core_fakecontact.\..birthday. ASC( NULLS FIRST)?, '
1004
1007
r'.creme_core_fakecontact.\..last_name. ASC( NULLS FIRST)?, '
1005
1008
r'.creme_core_fakecontact.\..first_name. ASC( NULLS FIRST)?, '
1006
- r'.creme_core_fakecontact.\..cremeentity_ptr_id. ASC( NULLS FIRST)? LIMIT'
1009
+ # r'.creme_core_fakecontact.\..cremeentity_ptr_id. ASC( NULLS FIRST)? LIMIT'
1010
+ r'.creme_core_fakecontact.\..cremeentity_ptr_id. ASC( NULLS FIRST)? LIMIT'
1007
1011
)
1008
1012
1009
1013
@override_settings (FAST_QUERY_MODE_THRESHOLD = 2 )
@@ -1014,7 +1018,8 @@ def test_ordering_fastmode_02(self):
1014
1018
sql ,
1015
1019
r'ORDER BY'
1016
1020
r' .creme_core_fakecontact.\..birthday. ASC( NULLS FIRST)?,'
1017
- r' .creme_core_fakecontact.\..cremeentity_ptr_id. ASC( NULLS FIRST)? LIMIT'
1021
+ # r' .creme_core_fakecontact.\..cremeentity_ptr_id. ASC( NULLS FIRST)? LIMIT'
1022
+ r' .creme_core_fakecontact.\..cremeentity_ptr_id. ASC( NULLS FIRST)? LIMIT'
1018
1023
)
1019
1024
1020
1025
def test_efilter01 (self ):
@@ -1176,8 +1181,10 @@ def test_header_buttons(self):
1176
1181
dl_uri = data_hrefs [1 ]
1177
1182
self .assertStartsWith (dl_uri , dl_url )
1178
1183
self .assertIn (f'hfilter={ hf .id } ' , dl_uri )
1179
- self .assertIn (f'&extra_q={ urlquote (q_filter )} ' , dl_uri )
1180
- self .assertIn (f'&search-regular_field-phone={ urlquote (searched_phone )} ' , dl_uri )
1184
+ # self.assertIn(f'&extra_q={urlquote(q_filter)}', dl_uri)
1185
+ self .assertIn (f'&extra_q={ quote (q_filter )} ' , dl_uri )
1186
+ # self.assertIn(f'&search-regular_field-phone={urlquote(searched_phone)}', dl_uri)
1187
+ self .assertIn (f'&search-regular_field-phone={ quote (searched_phone )} ' , dl_uri )
1181
1188
1182
1189
dl_header_uri = data_hrefs [2 ]
1183
1190
self .assertStartsWith (dl_header_uri , dl_url )
0 commit comments