12
12
import requests_mock
13
13
from django_webtest import WebTest
14
14
from freezegun import freeze_time
15
- from pyquery import PyQuery as PQ
15
+ from pyquery import PyQuery
16
16
from webtest import Upload
17
17
18
18
from open_inwoner .accounts .choices import NotificationChannelChoice , StatusChoices
@@ -153,7 +153,7 @@ def test_user_information_profile_page(self, m):
153
153
self .assertNotContains (response , "Bedrijfsgegevens" )
154
154
155
155
# check notification preferences displayed
156
- doc = PQ (response .content )
156
+ doc = PyQuery (response .content )
157
157
158
158
notifications_text = doc .find ("#profile-notifications" )[0 ].text_content ()
159
159
self .assertIn ("Mijn Berichten" , notifications_text )
@@ -171,7 +171,7 @@ def test_admin_disable_options(self, m):
171
171
172
172
response = self .app .get (self .url , user = self .user )
173
173
174
- doc = PQ (response .content )
174
+ doc = PyQuery (response .content )
175
175
176
176
self .assertEqual (doc .find ("#profile-notifications" ), [])
177
177
@@ -250,7 +250,7 @@ def test_info_eherkenning_user(self):
250
250
self .assertContains (response , "Fantasiestraat 42" )
251
251
self .assertContains (response , "1234 XY The good place" )
252
252
253
- doc = PQ (response .content )
253
+ doc = PyQuery (response .content )
254
254
255
255
business_section = doc .find ("#business-overview" )[0 ]
256
256
self .assertEqual (business_section .text .strip (), "Bedrijfsgegevens" )
@@ -1337,13 +1337,13 @@ def test_save_form_with_errors(self, m):
1337
1337
)
1338
1338
1339
1339
self .assertEqual (
1340
- PQ (subscribe_error ).text (),
1340
+ PyQuery (subscribe_error ).text (),
1341
1341
_ (
1342
1342
"Something went wrong while trying to subscribe to '{list_name}', please try again later"
1343
1343
).format (list_name = "Nieuwsbrief2" ),
1344
1344
)
1345
1345
self .assertEqual (
1346
- PQ (unsubscribe_error ).text (),
1346
+ PyQuery (unsubscribe_error ).text (),
1347
1347
_ (
1348
1348
"Something went wrong while trying to unsubscribe from '{list_name}', please try again later"
1349
1349
).format (list_name = "Nieuwsbrief1" ),
@@ -1500,30 +1500,36 @@ def test_render_list_if_appointments_are_found(self, m):
1500
1500
1501
1501
self .assertNotIn ("Old appointment" , response .text )
1502
1502
1503
- self .assertEqual (PQ (cards [0 ]).find (".card__heading-2" ).text (), "Paspoort" )
1503
+ self .assertEqual (PyQuery (cards [0 ]).find (".card__heading-2" ).text (), "Paspoort" )
1504
1504
1505
- passport_appointment = PQ (cards [0 ]).find ("ul" ).children ()
1505
+ passport_appointment = PyQuery (cards [0 ]).find ("ul" ).children ()
1506
1506
1507
- self .assertEqual (PQ (passport_appointment [0 ]).text (), "Datum\n 1 januari 2020" )
1508
- self .assertEqual (PQ (passport_appointment [1 ]).text (), "Tijd\n 13:00 uur" )
1509
- self .assertEqual (PQ (passport_appointment [2 ]).text (), "Locatie\n Hoofdkantoor" )
1510
- self .assertEqual (PQ (passport_appointment [3 ]).text (), "Dam 1" )
1511
- self .assertEqual (PQ (passport_appointment [4 ]).text (), "1234 ZZ Amsterdam" )
1512
1507
self .assertEqual (
1513
- PQ (cards [0 ]).find ("a" ).attr ("href" ),
1508
+ PyQuery (passport_appointment [0 ]).text (), "Datum\n 1 januari 2020"
1509
+ )
1510
+ self .assertEqual (PyQuery (passport_appointment [1 ]).text (), "Tijd\n 13:00 uur" )
1511
+ self .assertEqual (
1512
+ PyQuery (passport_appointment [2 ]).text (), "Locatie\n Hoofdkantoor"
1513
+ )
1514
+ self .assertEqual (PyQuery (passport_appointment [3 ]).text (), "Dam 1" )
1515
+ self .assertEqual (PyQuery (passport_appointment [4 ]).text (), "1234 ZZ Amsterdam" )
1516
+ self .assertEqual (
1517
+ PyQuery (cards [0 ]).find ("a" ).attr ("href" ),
1514
1518
f"{ self .data .config .booking_base_url } { self .data .appointment_passport .publicId } " ,
1515
1519
)
1516
1520
1517
- self .assertEqual (PQ (cards [1 ]).find (".card__heading-2" ).text (), "ID kaart" )
1521
+ self .assertEqual (PyQuery (cards [1 ]).find (".card__heading-2" ).text (), "ID kaart" )
1518
1522
1519
- id_card_appointment = PQ (cards [1 ]).find ("ul" ).children ()
1523
+ id_card_appointment = PyQuery (cards [1 ]).find ("ul" ).children ()
1520
1524
1521
- self .assertEqual (PQ (id_card_appointment [0 ]).text (), "Datum\n 6 maart 2020" )
1522
- self .assertEqual (PQ (id_card_appointment [1 ]).text (), "Tijd\n 11:30 uur" )
1523
- self .assertEqual (PQ (id_card_appointment [2 ]).text (), "Locatie\n Hoofdkantoor" )
1524
- self .assertEqual (PQ (id_card_appointment [3 ]).text (), "Wall Street 1" )
1525
- self .assertEqual (PQ (id_card_appointment [4 ]).text (), "1111 AA New York" )
1525
+ self .assertEqual (PyQuery (id_card_appointment [0 ]).text (), "Datum\n 6 maart 2020" )
1526
+ self .assertEqual (PyQuery (id_card_appointment [1 ]).text (), "Tijd\n 11:30 uur" )
1527
+ self .assertEqual (
1528
+ PyQuery (id_card_appointment [2 ]).text (), "Locatie\n Hoofdkantoor"
1529
+ )
1530
+ self .assertEqual (PyQuery (id_card_appointment [3 ]).text (), "Wall Street 1" )
1531
+ self .assertEqual (PyQuery (id_card_appointment [4 ]).text (), "1111 AA New York" )
1526
1532
self .assertEqual (
1527
- PQ (cards [1 ]).find ("a" ).attr ("href" ),
1533
+ PyQuery (cards [1 ]).find ("a" ).attr ("href" ),
1528
1534
f"{ self .data .config .booking_base_url } { self .data .appointment_idcard .publicId } " ,
1529
1535
)
0 commit comments