Commit 551514be authored by Kateryna Dobrogorska's avatar Kateryna Dobrogorska
Browse files

Merge branch 'kdi-88_locust' into 'master'

Search test

See merge request !11
parents 096ac6f0 b5eb0888
......@@ -16,6 +16,7 @@ django-import-export = "*"
django-filter = "~=21.1"
requests = "*"
twilio = "*"
locust = "*"
[dev-packages]
......
This diff is collapsed.
import random
from locust import HttpUser, task, between, TaskSet
class Searching(TaskSet):
"""
Emulate user searching doctors
"""
main_page_ulr = '/search_result/'
KEYWORDS = ['Tachycardia', 'Daryl Sexton', 'Dr. Guy Casey', 'Appendectomy', 'Anesthesiology']
@task(1)
def searching(self):
params = {}
if self.KEYWORDS:
keyword = random.choice(self.KEYWORDS)
params['q'] = keyword
self.client.get(self.main_page_ulr, data=params)
class TestUser(HttpUser):
wait_time = between(1, 5)
tasks = [Searching]
......@@ -6,9 +6,10 @@ pytest==5.3.5
pytest-sugar==0.9.2
pytest-django==3.8.0
django-import-export==2.8.0
requests
requests==2.27.1
vcrpy==4.1.1
twilio
twilio==7.9.0
flake8
pylint
pre-commit
locust==2.8.6
\ No newline at end of file
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment