username truncation functionality added
Some checks failed
ci/woodpecker/push/woodpecker Pipeline failed
Some checks failed
ci/woodpecker/push/woodpecker Pipeline failed
This commit is contained in:
@@ -8,7 +8,7 @@ from .base import FunctionalTest
|
|||||||
from apps.lyric.tasks import send_login_email_task
|
from apps.lyric.tasks import send_login_email_task
|
||||||
|
|
||||||
|
|
||||||
TEST_EMAIL = "discoman@example.com"
|
TEST_EMAIL = "disco@test.io"
|
||||||
SUBJECT = "A magic login link to your Dashboard"
|
SUBJECT = "A magic login link to your Dashboard"
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -8,7 +8,7 @@ from .my_lists_page import MyListsPage
|
|||||||
class MyListsTest(FunctionalTest):
|
class MyListsTest(FunctionalTest):
|
||||||
|
|
||||||
def test_logged_in_users_lists_are_saved_as_my_lists(self):
|
def test_logged_in_users_lists_are_saved_as_my_lists(self):
|
||||||
self.create_pre_authenticated_session("discoman@example.com")
|
self.create_pre_authenticated_session("disco@test.io")
|
||||||
|
|
||||||
self.browser.get(self.live_server_url)
|
self.browser.get(self.live_server_url)
|
||||||
list_page = ListPage(self)
|
list_page = ListPage(self)
|
||||||
@@ -16,7 +16,7 @@ class MyListsTest(FunctionalTest):
|
|||||||
list_page.add_list_item("Regurgitate spines")
|
list_page.add_list_item("Regurgitate spines")
|
||||||
first_list_url = self.browser.current_url
|
first_list_url = self.browser.current_url
|
||||||
|
|
||||||
MyListsPage(self).go_to_my_lists_page("discoman@example.com")
|
MyListsPage(self).go_to_my_lists_page("disco@test.io")
|
||||||
|
|
||||||
self.wait_for(
|
self.wait_for(
|
||||||
lambda: self.browser.find_element(By.LINK_TEXT, "Reticulate splines")
|
lambda: self.browser.find_element(By.LINK_TEXT, "Reticulate splines")
|
||||||
@@ -34,7 +34,7 @@ class MyListsTest(FunctionalTest):
|
|||||||
self.wait_for(
|
self.wait_for(
|
||||||
lambda: self.browser.find_element(By.LINK_TEXT, "Ribbon of death")
|
lambda: self.browser.find_element(By.LINK_TEXT, "Ribbon of death")
|
||||||
)
|
)
|
||||||
MyListsPage(self).go_to_my_lists_page("discoman@example.com")
|
MyListsPage(self).go_to_my_lists_page("disco@test.io")
|
||||||
|
|
||||||
self.browser.find_element(By.CSS_SELECTOR, "#id_logout").click()
|
self.browser.find_element(By.CSS_SELECTOR, "#id_logout").click()
|
||||||
self.wait_for(
|
self.wait_for(
|
||||||
|
|||||||
@@ -20,7 +20,7 @@ def quit_if_possible(browser):
|
|||||||
# Test mdls
|
# Test mdls
|
||||||
class SharingTest(FunctionalTest):
|
class SharingTest(FunctionalTest):
|
||||||
def test_can_share_a_list_with_another_user(self):
|
def test_can_share_a_list_with_another_user(self):
|
||||||
self.create_pre_authenticated_session("discoman@example.com")
|
self.create_pre_authenticated_session("disco@test.io")
|
||||||
disco_browser = self.browser
|
disco_browser = self.browser
|
||||||
self.addCleanup(lambda: quit_if_possible(disco_browser))
|
self.addCleanup(lambda: quit_if_possible(disco_browser))
|
||||||
|
|
||||||
@@ -30,7 +30,7 @@ class SharingTest(FunctionalTest):
|
|||||||
ali_browser = webdriver.Firefox(options=options)
|
ali_browser = webdriver.Firefox(options=options)
|
||||||
self.addCleanup(lambda: quit_if_possible(ali_browser))
|
self.addCleanup(lambda: quit_if_possible(ali_browser))
|
||||||
self.browser = ali_browser
|
self.browser = ali_browser
|
||||||
self.create_pre_authenticated_session("alice@example.com")
|
self.create_pre_authenticated_session("alice@test.io")
|
||||||
|
|
||||||
self.browser = disco_browser
|
self.browser = disco_browser
|
||||||
self.browser.get(self.live_server_url)
|
self.browser.get(self.live_server_url)
|
||||||
@@ -42,15 +42,15 @@ class SharingTest(FunctionalTest):
|
|||||||
"friend@example.com",
|
"friend@example.com",
|
||||||
)
|
)
|
||||||
|
|
||||||
list_page.share_list_with("alice@example.com")
|
list_page.share_list_with("alice@test.io")
|
||||||
|
|
||||||
self.browser = ali_browser
|
self.browser = ali_browser
|
||||||
MyListsPage(self).go_to_my_lists_page("alice@example.com")
|
MyListsPage(self).go_to_my_lists_page("alice@test.io")
|
||||||
|
|
||||||
self.browser.find_element(By.LINK_TEXT, "Send help").click()
|
self.browser.find_element(By.LINK_TEXT, "Send help").click()
|
||||||
|
|
||||||
self.wait_for(
|
self.wait_for(
|
||||||
lambda: self.assertEqual(list_page.get_list_owner(), "discoman@example.com")
|
lambda: self.assertEqual(list_page.get_list_owner(), "disco@test.io")
|
||||||
)
|
)
|
||||||
|
|
||||||
list_page.add_list_item("At your command, Disco King")
|
list_page.add_list_item("At your command, Disco King")
|
||||||
@@ -61,7 +61,7 @@ class SharingTest(FunctionalTest):
|
|||||||
|
|
||||||
class ListAccessTest(FunctionalTest):
|
class ListAccessTest(FunctionalTest):
|
||||||
def test_stranger_cannot_access_owned_list(self):
|
def test_stranger_cannot_access_owned_list(self):
|
||||||
self.create_pre_authenticated_session("disco@example.com")
|
self.create_pre_authenticated_session("disco@test.io")
|
||||||
self.browser.get(self.live_server_url)
|
self.browser.get(self.live_server_url)
|
||||||
list_page = ListPage(self).add_list_item("private eye")
|
list_page = ListPage(self).add_list_item("private eye")
|
||||||
list_url = self.browser.current_url
|
list_url = self.browser.current_url
|
||||||
|
|||||||
@@ -24,7 +24,7 @@
|
|||||||
<button type="submit" name="theme" value="{{ theme.name }}" class="btn btn-confirm">OK</button>
|
<button type="submit" name="theme" value="{{ theme.name }}" class="btn btn-confirm">OK</button>
|
||||||
</form>
|
</form>
|
||||||
{% else %}
|
{% else %}
|
||||||
<span class="btn btn-disabled">🔒</span>
|
<span class="btn btn-disabled">×</span>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
</div>
|
</div>
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
|
|||||||
@@ -1,4 +1,5 @@
|
|||||||
{% extends "core/base.html" %}
|
{% extends "core/base.html" %}
|
||||||
|
{% load lyric_extras %}
|
||||||
|
|
||||||
{% block title_text %}Your to-do list{% endblock title_text %}
|
{% block title_text %}Your to-do list{% endblock title_text %}
|
||||||
{% block header_text %}Your to-do list{% endblock header_text %}
|
{% block header_text %}Your to-do list{% endblock header_text %}
|
||||||
@@ -12,7 +13,7 @@
|
|||||||
{% block content %}
|
{% block content %}
|
||||||
<div class="row justify-content-center">
|
<div class="row justify-content-center">
|
||||||
<div class="col-lg-6">
|
<div class="col-lg-6">
|
||||||
<small>List created by: <span id="id_list_owner">{{ list.owner.email }}</span></small>
|
<small>List created by: <span id="id_list_owner">{{ list.owner|display_name }}</span></small>
|
||||||
<table id="id_list_table" class="table">
|
<table id="id_list_table" class="table">
|
||||||
{% for item in list.item_set.all %}
|
{% for item in list.item_set.all %}
|
||||||
<tr><td>{{ forloop.counter }}. {{ item.text }}</td></tr>
|
<tr><td>{{ forloop.counter }}. {{ item.text }}</td></tr>
|
||||||
@@ -44,7 +45,7 @@
|
|||||||
</form>
|
</form>
|
||||||
<small>List shared with:
|
<small>List shared with:
|
||||||
{% for user in list.shared_with.all %}
|
{% for user in list.shared_with.all %}
|
||||||
<span class="list-recipient">{{ user.email }}</span>
|
<span class="list-recipient">{{ user|display_name }}</span>
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
</small>
|
</small>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -1,9 +1,10 @@
|
|||||||
{% extends "core/base.html" %}
|
{% extends "core/base.html" %}
|
||||||
|
{% load lyric_extras %}
|
||||||
|
|
||||||
{% block header_text %}{{ user.email }}'s lists{% endblock header_text %}
|
{% block header_text %}{{ user|display_name }}'s lists{% endblock header_text %}
|
||||||
|
|
||||||
{% block content %}
|
{% block content %}
|
||||||
<h3>{{ owner.email }}'s lists</h3>
|
<h3>{{ owner|display_name }}'s lists</h3>
|
||||||
<ul>
|
<ul>
|
||||||
{% for list in owner.lists.all %}
|
{% for list in owner.lists.all %}
|
||||||
<li><a href="{{ list.get_absolute_url }}">{{ list.name }}</a></li>
|
<li><a href="{{ list.get_absolute_url }}">{{ list.name }}</a></li>
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
{% load compress %}
|
{% load compress %}
|
||||||
{% load static %}
|
{% load static %}
|
||||||
|
{% load lyric_extras %}
|
||||||
|
|
||||||
<!DOCTYPE html>
|
<!DOCTYPE html>
|
||||||
<html lang="en">
|
<html lang="en">
|
||||||
@@ -24,7 +25,7 @@
|
|||||||
</a>
|
</a>
|
||||||
{% if user.email %}
|
{% if user.email %}
|
||||||
<a class="navbar-link" href="{% url 'my_lists' user.id %}">My lists</a>
|
<a class="navbar-link" href="{% url 'my_lists' user.id %}">My lists</a>
|
||||||
<span class="navbar-text">Logged in as {{ user.email }}</span>
|
<span class="navbar-text">Logged in as {{ user|display_name }}</span>
|
||||||
<form method="POST" action="{% url "logout" %}">
|
<form method="POST" action="{% url "logout" %}">
|
||||||
{% csrf_token %}
|
{% csrf_token %}
|
||||||
<button id="id_logout" class="btn btn-outline-secondary" type="submit">
|
<button id="id_logout" class="btn btn-outline-secondary" type="submit">
|
||||||
|
|||||||
Reference in New Issue
Block a user