This commit is contained in:
Ross
2022-05-24 12:30:11 +01:00
parent bbcbc02e0d
commit 41a09ea30d
29 changed files with 506 additions and 247 deletions
-13
View File
@@ -1,13 +0,0 @@
{% extends 'rapids/base.html' %}
{% block content %}
{% for exam in exams %}
<div class="rapids">
<h1><a href="{% url 'rapids:exam_overview' pk=exam.pk %}">Exam: {{ exam.name }} </a></h1>
{% if exam.exam_mode %}
{% if request.user.is_staff %}<a href="{% url 'rapids:mark' exam_pk=exam.pk sk=0 %}">Mark answers</a>{% endif %}
{% if request.user.is_staff %}<a href="{% url 'rapids:exam_scores_cid' pk=exam.pk %}">Scores</a>{% endif %}
{% endif %}
</div>
{% endfor %}
{% endblock %}
-23
View File
@@ -1,23 +0,0 @@
{% extends 'rapids/base.html' %}
{% block content %}
My Questions:
<ul>
{% for rapid in user_rapids %}
<li{% if rapid.scrapped %} class='rapid-scrapped' {% endif %}><a
href="{% url 'rapids:question_detail' pk=rapid.pk %}">{{rapid}}
[{{rapid.get_authors}}]</a></li>
{% endfor %}
</ul>
Other Questions:
<ul>
{% for rapid in other_rapids %}
<li{% if rapid.scrapped %} class='rapid-scrapped' {% endif %}><a
href="{% url 'rapids:question_detail' pk=rapid.pk %}">{{rapid}} [{{rapid.get_authors}}]</a></li>
{% endfor %}
</ul>
{% endblock %}
+9 -2
View File
@@ -2,11 +2,18 @@ import pytest
#from django.contrib.auth.models import User
from django.urls import reverse
APP_NAMES = ("rapids", "anatomy", "longs", "physics", "sbas")
@pytest.fixture
def create_superuser(db, django_user_model):
return django_user_model.objects.create_superuser("admin", "ross@xkjq.uk", "adminpassword")
def test_index(client, create_superuser):
# Very basic tests, make sure we can hit key urls without error
@pytest.mark.parametrize("app_name", APP_NAMES)
def test_index(client, create_superuser, app_name):
client.login(username="admin", password="adminpassword")
response = client.get(reverse('rapids:index'))
response = client.get(reverse(f'{app_name}:index'))
print(response.status_code)
print(response)
assert response.status_code == 200