fix a silly bug

This commit is contained in:
Ross
2024-12-23 16:38:37 +00:00
parent 4981402ca9
commit 13713d870f
3 changed files with 6 additions and 4 deletions
+1 -1
View File
@@ -11,5 +11,5 @@
<a href="{% url 'anatomy:exam_cids' exam_id=exam.pk %}">Candidates</a> /
<a href="{% url 'anatomy:exam_stats' exam_id=exam.pk %}">Stats</a> /
{% endif %}
<a href="{% url 'anatomy:create_exam' pk=exam.pk %}" title="Add a new question directly into the exam.">Add New Question</a>
{% comment %} <a href="{% url 'anatomy:question_create_exam' pk=exam.pk %}" title="Add a new question directly into the exam.">Add New Question</a> {% endcomment %}
{% endblock %}
+1
View File
@@ -315,6 +315,7 @@ class SupervisorTable(tables.Table):
sequence = ("name", "email")
exclude = ("id",)
attrs = {"id": "supervisor-table"}
def render_edit(self, value, record):
url = f"{reverse("generic:supervisor_edit", args=[record.pk])}?redirect={self.request.path}"
+4 -3
View File
@@ -306,7 +306,7 @@ def test_supervisor_management(db, faker, client, create_cid_manager, django_use
assert response.status_code == 200
soup = BeautifulSoup(response.content, "html.parser")
assert len(soup.find(id="tbody").find_all("tr")) == 2
assert len(soup.find(id="supervisor-table").find("tbody").find_all("tr")) == 2
response = client.get(reverse(f"generic:supervisor_detail", kwargs={"pk": s1.pk}))
soup = BeautifulSoup(response.content, "html.parser")
@@ -331,7 +331,8 @@ def test_supervisor_management(db, faker, client, create_cid_manager, django_use
assert response.status_code == 200
soup = BeautifulSoup(response.content, "html.parser")
assert len(soup.find(id="supervisor-list").find_all("li")) == 1
assert len(soup.find(id="supervisor-table").find("tbody").find_all("tr")) == 1
#assert len(soup.find(id="supervisor-list").find_all("li")) == 1
response = client.post(reverse(f"generic:supervisor_create"), {"email":faker.email(), "name": faker.name()})
assert response.status_code == 302
@@ -340,7 +341,7 @@ def test_supervisor_management(db, faker, client, create_cid_manager, django_use
assert response.status_code == 200
soup = BeautifulSoup(response.content, "html.parser")
assert len(soup.find(id="supervisor-list").find_all("li")) == 2
assert len(soup.find(id="supervisor-table").find("tbody").find_all("tr")) == 2
def test_privacy(db, client):