parent
6b90764132
commit
d580080232
@ -51,8 +51,8 @@ PAGE_DEFAULT = 1
|
|||||||
# SSO settings
|
# SSO settings
|
||||||
SSO_SERVER_BASE = "http://127.0.0.1:8000/"
|
SSO_SERVER_BASE = "http://127.0.0.1:8000/"
|
||||||
SSO_SERVER = f"{SSO_SERVER_BASE}sso/"
|
SSO_SERVER = f"{SSO_SERVER_BASE}sso/"
|
||||||
SSO_PRIVATE_KEY = "U7OjCbElNDchUvh9WVzfOfC4juJQC9HGZI9tSdjmeFe0MDTw7BCNBv4MigJ79dlJ"
|
SSO_PRIVATE_KEY = "CHANGE_ME"
|
||||||
SSO_PUBLIC_KEY = "PnxIZFewXVoL0FG2wMr3DCGgLCHOwR6JE9GYJCZHazVjlDgOZFl3qiB4dWsAZRF5"
|
SSO_PUBLIC_KEY = "CHANGE_ME"
|
||||||
|
|
||||||
# MAPS
|
# MAPS
|
||||||
DEFAULT_LAT = 50.00
|
DEFAULT_LAT = 50.00
|
||||||
|
@ -23,6 +23,8 @@ class AutocompleteTestCase(BaseTestCase):
|
|||||||
self.client.login(username=self.superuser.username, password=self.superuser_pw)
|
self.client.login(username=self.superuser.username, password=self.superuser_pw)
|
||||||
user_autocomplete_url = reverse("share-user-autocomplete")
|
user_autocomplete_url = reverse("share-user-autocomplete")
|
||||||
username = self.user.username
|
username = self.user.username
|
||||||
|
|
||||||
|
# Provide the full name --> success
|
||||||
data = {
|
data = {
|
||||||
"q": username
|
"q": username
|
||||||
}
|
}
|
||||||
@ -33,3 +35,25 @@ class AutocompleteTestCase(BaseTestCase):
|
|||||||
content = json.loads(response.content)
|
content = json.loads(response.content)
|
||||||
self.assertEqual(username, content["results"][0]["text"])
|
self.assertEqual(username, content["results"][0]["text"])
|
||||||
self.assertEqual(str(self.user.id), content["results"][0]["id"])
|
self.assertEqual(str(self.user.id), content["results"][0]["id"])
|
||||||
|
|
||||||
|
# Provide only the first letter --> no result
|
||||||
|
data = {
|
||||||
|
"q": username[0]
|
||||||
|
}
|
||||||
|
response = self.client.get(
|
||||||
|
user_autocomplete_url,
|
||||||
|
data,
|
||||||
|
)
|
||||||
|
content = json.loads(response.content)
|
||||||
|
self.assertEqual([], content["results"])
|
||||||
|
|
||||||
|
# Provide full name + too much --> no result
|
||||||
|
data = {
|
||||||
|
"q": username + "t"
|
||||||
|
}
|
||||||
|
response = self.client.get(
|
||||||
|
user_autocomplete_url,
|
||||||
|
data,
|
||||||
|
)
|
||||||
|
content = json.loads(response.content)
|
||||||
|
self.assertEqual([], content["results"])
|
||||||
|
Loading…
Reference in New Issue
Block a user