How to use make_user method in Django Test Plus

Best Python code snippet using django-test-plus_python

test_views.py

Source:test_views.py Github

copy

Full Screen

...15@mock.patch('users.models.UPVLoginDataService', new=UPVLoginDataService)16class JourneyViewTests(TestCase):17 user_factory = UserFactory18 def test_get_create_journey(self):19 user = self.make_user(username="foo")20 url_name = "journeys:create"21 self.assertLoginRequired(url_name)22 with self.login(user):23 response = self.get(url_name)24 self.response_200(response=response)25 def test_post_create_journey(self):26 user = self.make_user(username="foo")27 self.assertLoginRequired("journeys:create")28 with self.login(user):29 data = {30 "origin": "residence:%s" % ResidenceFactory(user=user).pk,31 "destiny": "campus:%s" % CampusFactory().pk,32 "free_places": 4,33 "time_window": 30,34 "departure": (timezone.now() + datetime.timedelta(days=1)).strftime("%Y-%m-%d %H:%M:%S"),35 "recurrence": "",36 }37 response = self.post(url_name="journeys:create", data=data)38 self.response_302(response)39 self.assertEquals(1, Journey.objects.count())40 def test_post_create_arrival_journey(self):41 user = self.make_user(username="foo")42 self.assertLoginRequired("journeys:create")43 with self.login(user):44 data = {45 "origin": "residence:%s" % ResidenceFactory(user=user).pk,46 "destiny": "campus:%s" % CampusFactory().pk,47 "free_places": 4,48 "time_window": 30,49 "departure": (timezone.now() + datetime.timedelta(days=1)).strftime("%Y-%m-%d %H:%M:%S"),50 "arrival": (timezone.now() + datetime.timedelta(days=1, minutes=30)).strftime("%Y-%m-%d %H:%M:%S"),51 "recurrence": "",52 }53 response = self.post(url_name="journeys:create", data=data)54 self.response_302(response)55 self.assertEquals(1, Journey.objects.count())56 def test_post_create_bad_arrival_journey(self):57 user = self.make_user(username="foo")58 self.assertLoginRequired("journeys:create")59 with self.login(user):60 data = {61 "origin": "residence:%s" % ResidenceFactory(user=user).pk,62 "destiny": "campus:%s" % CampusFactory().pk,63 "free_places": 4,64 "time_window": 30,65 "departure": (timezone.now() + datetime.timedelta(days=1)).strftime("%Y-%m-%d %H:%M:%S"),66 "arrival": (timezone.now() + datetime.timedelta(minutes=30)).strftime("%Y-%m-%d %H:%M:%S"),67 "recurrence": "",68 }69 response = self.post(url_name="journeys:create", data=data)70 self.response_200(response)71 self.assertEquals(0, Journey.objects.count())72 def test_post_create_bad_departure_journey(self):73 user = self.make_user(username="foo")74 self.assertLoginRequired("journeys:create")75 with self.login(user):76 data = {77 "origin": "residence:%s" % ResidenceFactory(user=user).pk,78 "destiny": "campus:%s" % CampusFactory().pk,79 "free_places": 4,80 "time_window": 30,81 "departure": (timezone.now() - datetime.timedelta(days=1)).strftime("%Y-%m-%d %H:%M:%S"),82 "arrival": (timezone.now() + datetime.timedelta(minutes=30)).strftime("%Y-%m-%d %H:%M:%S"),83 "recurrence": "",84 }85 response = self.post(url_name="journeys:create", data=data)86 self.response_200(response)87 self.assertEquals(0, Journey.objects.count())88 def test_get_edit_journey(self):89 user = self.make_user(username="foo")90 journey = JourneyFactory(template=JourneyTemplateFactory(user=user))91 url_name = "journeys:edit"92 self.assertLoginRequired(url_name, pk=journey.pk)93 with self.login(user):94 response = self.get(url_name, pk=journey.pk)95 self.response_200(response=response)96 def test_post_edit_journey(self):97 user = self.make_user(username="foo")98 template = JourneyTemplateFactory(user=user, kind=GOING)99 journey = JourneyFactory(template=template)100 url_name = "journeys:edit"101 self.assertLoginRequired(url_name, pk=journey.pk)102 with self.login(user):103 data = {104 # "residence": ResidenceFactory(user=user).pk,105 # "campus": CampusFactory().pk,106 # "kind": RETURN,107 "free_places": 3,108 # "time_window": 30,109 "departure": (timezone.now() + datetime.timedelta(days=1)).strftime("%Y-%m-%d %H:%M:%S"),110 "recurrence": "",111 }112 response = self.post(url_name=url_name, pk=journey.pk, data=data)113 self.response_302(response=response)114 journey = Journey.objects.get(pk=journey.pk)115 self.assertEquals(data["free_places"], journey.free_places)116 def test_get_recommended_journey(self):117 user = self.make_user(username="foo")118 url_name = "journeys:recommended"119 self.assertLoginRequired(url_name)120 with self.login(user):121 response = self.get(url_name)122 self.response_200(response=response)123 def test_get_recommended_journey_filter(self):124 user = self.make_user(username="foo")125 url_name = "journeys:recommended"126 self.assertLoginRequired(url_name)127 with self.login(user):128 response = self.get(url_name, data={"distance": 200, "kind": GOING})129 self.response_200(response=response)130 def test_get_list_journey(self):131 user = self.make_user(username="foo")132 url_name = "journeys:list"133 self.assertLoginRequired(url_name)134 with self.login(user):135 response = self.get(url_name)136 self.response_200(response=response)137 def test_post_join(self):138 user = self.make_user(username="foo")139 template = JourneyTemplateFactory(user=user, kind=GOING)140 journey = JourneyFactory(template=template)141 url_name = "journeys:join"142 self.assertLoginRequired(url_name, pk=journey.pk)143 with self.login(user):144 response = self.post(url_name=url_name, pk=journey.pk)145 self.response_302(response=response)146 def test_post_join_recurrence_all(self):147 user = self.make_user(username="foo")148 template = JourneyTemplateFactory(user=user, kind=GOING)149 journey = JourneyFactory(template=template)150 journeys = [JourneyFactory(template=template) for _ in range(10)]151 url_name = "journeys:join"152 self.assertLoginRequired(url_name, pk=journey.pk)153 with self.login(user):154 data = {155 "join_to": "all"156 }157 response = self.post(url_name=url_name, pk=journey.pk, data=data)158 self.response_302(response=response)159 self.assertEquals(len(journeys) + 1, Passenger.objects.count())160 def test_post_join_recurrence_one(self):161 user = self.make_user(username="foo")162 template = JourneyTemplateFactory(user=user, kind=GOING)163 journey = JourneyFactory(template=template)164 [JourneyFactory(template=template) for _ in range(10)]165 url_name = "journeys:join"166 self.assertLoginRequired(url_name, pk=journey.pk)167 with self.login(user):168 data = {169 "join_to": "one"170 }171 response = self.post(url_name=url_name, pk=journey.pk, data=data)172 self.response_302(response=response)173 self.assertEquals(1, Passenger.objects.count())174 def test_post_leave(self):175 user = self.make_user(username="foo")176 journey = JourneyFactory(template=JourneyTemplateFactory(user=user))177 journey.join_passenger(user)178 url_name = "journeys:leave"179 self.assertLoginRequired(url_name, pk=journey.pk)180 with self.login(user):181 response = self.post(url_name=url_name, pk=journey.pk)182 self.response_302(response=response)183 def test_post_throw_out(self):184 user = self.make_user(username="foo")185 journey = JourneyFactory(template=JourneyTemplateFactory(user=user))186 passenger = journey.join_passenger(user)187 url_name = "journeys:throw-out"188 self.assertLoginRequired(url_name, pk=passenger.pk)189 with self.login(user):190 response = self.post(url_name=url_name, pk=passenger.pk)191 self.response_302(response=response)192 def test_cancel_journey(self):193 user = self.make_user(username="foo")194 template = JourneyTemplateFactory(user=user)195 journey = JourneyFactory(template=template)196 url_name = "journeys:cancel"197 self.assertLoginRequired(url_name, pk=journey.pk)198 with self.login(user):199 response = self.get(url_name, pk=journey.pk)200 self.response_200(response=response)201 def test_post_cancel_journey(self):202 user = self.make_user(username="foo")203 template = JourneyTemplateFactory(user=user)204 journey = JourneyFactory(template=template)205 url_name = "journeys:cancel"206 self.assertLoginRequired(url_name, pk=journey.pk)207 with self.login(user):208 response = self.post(url_name, pk=journey.pk)209 self.response_302(response=response)210 self.assertTrue(Journey.objects.get(pk=journey.pk).disabled)211 def test_delete_journey(self):212 user = self.make_user(username="foo")213 journeys = [JourneyFactory(template=JourneyTemplateFactory(user=user)) for _ in range(10)]214 journey = JourneyFactory(template=JourneyTemplateFactory(user=user))215 url_name = "journeys:delete"216 self.assertLoginRequired(url_name, pk=journey.pk)217 self.assertEquals(len(journeys) + 1, Journey.objects.count())218 with self.login(user):219 response = self.get(url_name, pk=journey.pk)220 self.response_302(response=response)221 self.assertFalse(Journey.objects.filter(pk=journey.pk).exists())222 self.assertEquals(len(journeys), Journey.objects.count())223 def test_delete_parent_journeys(self):224 user = self.make_user(username="foo")225 template = JourneyTemplateFactory(user=user)226 journey = JourneyFactory(template=template)227 journeys = [JourneyFactory(template=template) for _ in range(10)]228 url_name = "journeys:delete"229 self.assertLoginRequired(url_name, pk=journey.pk)230 self.assertEquals(len(journeys) + 1, Journey.objects.count())231 with self.login(user):232 response = self.get(url_name, pk=journey.pk)233 self.response_302(response=response)234 self.assertFalse(Journey.objects.filter(pk=journey.pk).exists())235 self.assertEquals(len(journeys), Journey.objects.count())236 def test_delete_all_journeys(self):237 user = self.make_user(username="foo")238 template = JourneyTemplateFactory(user=user)239 journey = JourneyFactory(template=template)240 journeys = [JourneyFactory(template=template) for _ in range(10)]241 other_journeys = [JourneyFactory() for _ in range(5)]242 url_name = "journeys:delete-all"243 self.assertLoginRequired(url_name, pk=journey.pk)244 self.assertEquals(len(journeys) + len(other_journeys) + 1, Journey.objects.count())245 with self.login(user):246 response = self.get(url_name, pk=journey.pk)247 self.response_302(response=response)248 self.assertFalse(Journey.objects.filter(pk=journey.pk).exists())249 self.assertEquals(len(other_journeys), Journey.objects.count())250@mock.patch('users.models.UPVLoginDataService', new=UPVLoginDataService)251class ResidenceViewTests(TestCase):252 user_factory = UserFactory253 def test_get_create_residence(self):254 user = self.make_user(username="foo")255 url_name = "journeys:create-residence"256 self.assertLoginRequired(url_name)257 with self.login(user):258 response = self.get(url_name)259 self.response_200(response=response)260 def test_post_create_residence(self):261 user = self.make_user(username="foo")262 self.assertLoginRequired("journeys:create-residence")263 with self.login(user):264 data = {265 "name": "Home",266 "address": "foo",267 "position": "POINT (-0.3819 39.4625)",268 "distance": 500,269 }270 response = self.post(url_name="journeys:create-residence", data=data)271 self.response_302(response)272 self.assertEquals(1, Residence.objects.count())273 def test_get_edit_residence(self):274 user = self.make_user(username="foo")275 residence = ResidenceFactory(user=user)276 url_name = "journeys:edit-residence"277 self.assertLoginRequired(url_name, pk=residence.pk)278 with self.login(user):279 response = self.get(url_name, pk=residence.pk)280 self.response_200(response=response)281 def test_post_edit_residence(self):282 user = self.make_user(username="foo")283 residence = ResidenceFactory(user=user)284 url_name = "journeys:edit-residence"285 self.assertLoginRequired(url_name, pk=residence.pk)286 with self.login(user):287 data = {288 "name": "Home",289 "address": "bar",290 "position": "POINT (-0.3819 39.4625)",291 "distance": 500292 }293 response = self.post(url_name=url_name, pk=residence.pk, data=data)294 self.response_302(response=response)295 residence = Residence.objects.get(pk=residence.pk)296 self.assertEquals(data["address"], residence.address)297 def test_residences(self):298 user = self.make_user(username="foo")299 ResidenceFactory(user=user)300 url_name = "journeys:residences"301 self.assertLoginRequired(url_name)302 with self.login(user):303 response = self.get(url_name)304 self.response_200(response=response)305 def test_delete_residence(self):306 user = self.make_user(username="foo")307 residence = ResidenceFactory(user=user)308 url_name = "journeys:delete-residence"309 self.assertLoginRequired(url_name, pk=residence.pk)310 with self.login(user):311 response = self.get(url_name, pk=residence.pk)312 self.response_302(response=response)313 def test_no_delete_residence(self):314 initial_user = self.make_user(username="foo")315 user = UserFactory()316 residence = ResidenceFactory(user=initial_user)317 url_name = "journeys:delete-residence"318 self.assertLoginRequired(url_name, pk=residence.pk)319 with self.login(user):320 response = self.get(url_name, pk=residence.pk)...

Full Screen

Full Screen

test_bot.py

Source:test_bot.py Github

copy

Full Screen

...74 return test.make_channel(guild, id=get_channel_from_config('counting'))75@pytest.mark.asyncio76async def test_avatar(test: discordpytest.Tester, channel, guild):77 user_1 = test.make_member(78 guild, test.make_user(1, 'mat', '1234', avatar='asdf'))79 await test.message('!avatar mat', channel)80 await test.verify_message(lambda m: m['content'].startswith('https://cdn.discordapp.com/avatars/1/asdf.'))81@pytest.mark.asyncio82async def test_b(test: discordpytest.Tester, channel):83 await test.message('!b', channel)84 await test.verify_message('I like french bread')85@pytest.mark.asyncio86async def test_bleach(test: discordpytest.Tester, channel):87 await test.message('!bleach', channel)88 await test.verify_message(89 lambda m: m['embeds'][0].get('title') == 'Here\'s a Clorox bleach if you want to unsee something weird:'90 )91# @pytest.mark.asyncio92# async def test_bobux(test: discordpytest.Tester, channel):93# await test.message('!bobux', channel)94@pytest.mark.asyncio95async def test_e(test: discordpytest.Tester, channel):96 await test.message('!e', channel)97 await test.verify_message('e')98@pytest.mark.asyncio99async def test_forum(test: discordpytest.Tester, channel):100 await test.message('!forum', channel)101 await test.verify_message('Forum commands: **!forums user (username)**')102@pytest.mark.asyncio103async def test_debugmember(client, test: discordpytest.Tester, channel, guild):104 user_1 = test.make_member(guild, test.make_user(1, 'mat', '1234'))105 user_2 = test.make_member(guild, test.make_user(2, 'matdoesdev', '4321'))106 user_3 = test.make_member(guild, test.make_user(3, 'gaming', '1234'))107 user_2 = test.make_member(guild, test.make_user(4, 'mat does dev', '4321'))108 await test.message('!debugmember mat', channel)109 await test.verify_message(lambda m: m['embeds'][0].get('description') == '<@1>')110 await test.message('!debugmember matdoesdev', channel)111 await test.verify_message(lambda m: m['embeds'][0].get('description') == '<@2>')112 await test.message('!debugmember mat does dev', channel)113 await test.verify_message(lambda m: m['embeds'][0].get('description') == '<@4>')114 await test.message('!debugmember mat d', channel)115 await test.verify_message(lambda m: m['embeds'][0].get('description') == '<@4>')116 await test.message('!debugmember matd', channel)117 await test.verify_message(lambda m: m['embeds'][0].get('description') == '<@2>')118 await test.message('!debugmember mat#1234', channel)119 await test.verify_message(lambda m: m['embeds'][0].get('description') == '<@1>')120 await test.message('!debugmember m#1234', channel)121 await test.verify_message('Unknown member')122 await test.message('!debugmember Mat', channel)123 await test.verify_message(lambda m: m['embeds'][0].get('description') == '<@1>')124 await test.message('!debugmember MATDOESDE', channel)125 await test.verify_message(lambda m: m['embeds'][0].get('description') == '<@2>')126 await test.message('!debugmember g', channel)127 await test.verify_message(lambda m: m['embeds'][0].get('description') == '<@3>')128@pytest.mark.asyncio129async def test_debugtime(client, test: discordpytest.Tester, channel):130 time_tests = {131 '1 second': '1 second',132 '2 seconds': '2 seconds',133 '59 seconds': '59 seconds',134 '1s': '1 second',135 '1seconds': '1 second',136 '30 seconds': '30 seconds',137 '60 seconds': '1 minute',138 '599seconds': '9 minutes and 59 seconds',139 '3600s': '1 hour',140 '1 minute': '1 minute',141 '2 minutes': '2 minutes',142 '59 minute': '59 minutes',143 '61m': '1 hour and 1 minute',144 }145 for test_input in time_tests:146 test_expected_output = time_tests[test_input]147 await test.message(f'!debugtime {test_input}', channel)148 await test.verify_message(test_expected_output)149@pytest.mark.asyncio150async def test_duel_general_win(client, test):151 guild = test.make_guild(id=config.main_guild)152 general = test.make_channel(guild, id=config.channels['general'])153 user = test.make_member(guild, test.make_user(1, 'mat', '6207'))154 await test.message('!duel <@719348452491919401>', general, user)155 await test.verify_message(156 lambda m: m['content'].startswith('<@719348452491919401>, react to this message with :gun: to duel <@1>.')157 )158 await test.verify_message('Duel starting in 10 seconds... First person to type :gun: once the countdown ends, wins.')159 await test.verify_message('5')160 await test.verify_message('4')161 await test.verify_message('3')162 await test.verify_message('2')163 await test.verify_message('1')164 await test.verify_message('Shoot')165 await asyncio.sleep(0)166 await test.message(':gun:', general, user)167 await test.verify_message('<@1> won the duel!')168@pytest.mark.asyncio169async def test_counter(client, test: discordpytest.Tester, channel):170 await test.message('!counter', channel)171 await test.verify_message('1')172@pytest.mark.asyncio173async def test_counting(client, test: discordpytest.Tester, guild, counting_channel):174 new_member = test.make_member(guild, test.make_user(533502154191798273, 'Otty', '5345'))175 other_new_member = test.make_member(guild, test.make_user(533502154191798274, 'alt', '9999'))176 member = test.make_member(guild, test.make_user(999999999999999999, 'mat', '0001'))177 other_member = test.make_member(guild, test.make_user(999999999999999999, 'duck', '0001'))178 # make sure new members can count correct numbers179 m = await test.message('2', counting_channel, new_member)180 await test.verify_reaction_added(lambda r: r['emoji'] == bot.COUNTING_CONFIRMATION_EMOJI and str(r['message_id']) == str(m['id']))181 # make sure normal members can still count182 m = await test.message('3', counting_channel, member)183 await test.verify_reaction_added(lambda r: r['emoji'] == bot.COUNTING_CONFIRMATION_EMOJI and str(r['message_id']) == str(m['id']))184 # make sure new members can't count the wrong number185 m = await test.message('troll', counting_channel, other_new_member)186 await test.verify_message_deleted(int(m['id']))187 # make sure old members can still count the wrong number188 test.clear_queues()189 m = await test.message('troll', counting_channel, other_member)190 await test.verify_message(lambda m: m['content'].startswith(f'<@{other_member.id}> put an invalid number and ruined it for everyone'))191@pytest.mark.asyncio192async def test_filter(client, test: discordpytest.Tester, channel):193 m = await test.message('th¡swordisblacklistʒdyoulitƷrallycannotsayit', channel)194 await test.verify_message_deleted(int(m['id']))195@pytest.mark.asyncio196async def test_spamping(client, test: discordpytest.Tester, guild, channel):197 test.make_member(guild, test.make_user(11, 'one', '0001'))198 test.make_member(guild, test.make_user(12, 'two', '0002'))199 test.make_member(guild, test.make_user(13, 'three', '0003'))200 test.make_member(guild, test.make_user(14, 'four', '0004'))201 test.make_member(guild, test.make_user(15, 'five', '0005'))202 test.make_member(guild, test.make_user(16, 'six', '0006'))203 test.make_member(guild, test.make_user(17, 'seven', '0007'))204 test.make_member(guild, test.make_user(18, 'eight', '0008'))205 test.make_member(guild, test.make_user(19, 'nine', '0009'))206 test.make_member(guild, test.make_user(110, 'ten', '0010'))207 m = await test.message('<@11> <@12> <@13> <@14> <@15> <@16> <@17> <@18> <@19> <@110>', channel)208 await test.verify_message_deleted(int(m['id']))209@pytest.mark.asyncio210async def test_morse(client, test: discordpytest.Tester, channel):211 await test.message('!morse .... . .-.. .-.. ---', channel)212 await test.verify_message(lambda m: m['embeds'][0].get('description') == 'hello')213 await test.message('!morse hello', channel)214 await test.verify_message(lambda m: m['embeds'][0].get('description', '').strip() == '.... . .-.. .-.. ---')215 # thiswordisblacklistedyouliterallycannotsayit216 m = await test.message('!morse - .... .. ... .-- --- .-. -.. .. ... -... .-.. .- -.-. -.- .-.. .. ... - . -.. -.-- --- ..- .-.. .. - . .-. .- .-.. .-.. -.-- -.-. .- -. -. --- - ... .- -.-- .. -', channel)217 await test.verify_message_deleted(int(m['id']))218@pytest.mark.asyncio219async def test_help(client, test: discordpytest.Tester, channel):220 await test.message('!help', channel)...

Full Screen

Full Screen

test_models_user.py

Source:test_models_user.py Github

copy

Full Screen

...4@pytest.mark.usefixtures(5 "app", "mock_retrieve_jwt_claims", "mock_bearer_validation", "jwt_clinician_login"6)7class TestModelsUser:8 def make_user(self) -> User:9 clinician_uuid: str = create_clinician(10 first_name="A",11 last_name="A",12 nhs_smartcard_number="123456",13 product_name="SEND",14 expiry=None,15 login_active=True,16 send_entry_identifier="321",17 )["uuid"]18 return User.query.get(clinician_uuid)19 def test_schema(self) -> None:20 assert User.schema()["optional"] == {21 "login_active": bool,22 "contract_expiry_eod_date": str,23 "send_entry_identifier": str,24 "bookmarks": [str],25 "bookmarked_patients": [str],26 "can_edit_encounter": bool,27 "can_edit_ews": bool,28 "professional_registration_number": str,29 "agency_name": str,30 "agency_staff_employee_number": str,31 "email_address": str,32 "booking_reference": str,33 "analytics_consent": bool,34 }35 def test_update(self) -> None:36 clinician: User = self.make_user()37 clinician.update(38 groups=["GDM Clinician"],39 bookmarks=["LOCATION_UUID_2"],40 bookmarked_patients=["PATIENT_UUID_1"],41 locations=["LOCATION_UUID_1"],42 products=[43 {44 "uuid": clinician.products[0].uuid,45 "product_name": "SEND",46 "opened_date": "2021-07-01",47 "closed_date": "2021-07-02",48 }49 ],50 )51 assert str(clinician.products[0].opened_date) == "2021-07-01"52 assert clinician.locations[0] == "LOCATION_UUID_1"53 assert clinician.bookmarks[0] == "LOCATION_UUID_2"54 assert clinician.bookmarked_patients[0] == "PATIENT_UUID_1"55 def test_duplicate_product_update(self) -> None:56 clinician: User = self.make_user()57 with pytest.raises(ValueError):58 clinician.update(59 products=[60 {61 "uuid": clinician.products[0].uuid,62 "product_name": "SEND",63 "opened_date": "2021-07-01",64 },65 {66 "product_name": "SEND",67 "opened_date": "2021-07-01",68 },69 ],70 )71 def test_generate_secure_random_string_fail(self) -> None:72 clinician: User = self.make_user()73 with pytest.raises(ValueError):74 clinician.generate_secure_random_string(2)75 def test_generate_password_hash_fail(self) -> None:76 clinician: User = self.make_user()77 with pytest.raises(RuntimeError):78 clinician.generate_password_hash("1234")79 def test_validate_password_fail(self) -> None:80 clinician: User = self.make_user()81 clinician.set_password("inconceivable")82 assert clinician.validate_password("1234") == False83 def test_analytics_consent(self) -> None:84 clinician: User = self.make_user()85 assert "analytics_consent" not in clinician.to_dict()86 clinician.analytics_consent = True87 assert clinician.to_dict()["analytics_consent"] == True88 def test_update_bookmarks(self) -> None:89 clinician: User = self.make_user()90 clinician.update(bookmarks=["LOC1"])91 assert clinician.to_dict()["bookmarks"] == ["LOC1"]92 clinician.update(bookmarks=["LOC2"])93 assert clinician.to_dict()["bookmarks"] == ["LOC2"]94 def test_update_bookmarked_patients(self) -> None:95 clinician: User = self.make_user()96 clinician.update(bookmarked_patients=["P1"])97 assert clinician.to_dict()["bookmarked_patients"] == ["P1"]98 clinician.update(bookmarked_patients=["P2"])99 assert clinician.to_dict()["bookmarked_patients"] == ["P2"]100 def test_update_products(self) -> None:101 clinician: User = self.make_user()102 clinician.update(103 products=[{"product_name": "DBM", "opened_date": "2021-08-01"}]104 )...

Full Screen

Full Screen

Automation Testing Tutorials

Learn to execute automation testing from scratch with LambdaTest Learning Hub. Right from setting up the prerequisites to run your first automation test, to following best practices and diving deeper into advanced test scenarios. LambdaTest Learning Hubs compile a list of step-by-step guides to help you be proficient with different test automation frameworks i.e. Selenium, Cypress, TestNG etc.

LambdaTest Learning Hubs:

YouTube

You could also refer to video tutorials over LambdaTest YouTube channel to get step by step demonstration from industry experts.

Run Django Test Plus automation tests on LambdaTest cloud grid

Perform automation testing on 3000+ real desktop and mobile devices online.

Try LambdaTest Now !!

Get 100 minutes of automation test minutes FREE!!

Next-Gen App & Browser Testing Cloud

Was this article helpful?

Helpful

NotHelpful