mirror of
https://github.com/etnguyen03/tjdests.git
synced 2025-04-20 17:50:16 -04:00
feat: add GPA view, editing, tests
This commit is contained in:
parent
6eb0a331ed
commit
c6d5f7ecf1
|
@ -24,7 +24,7 @@ class ProfilePublishForm(forms.ModelForm):
|
||||||
|
|
||||||
class Meta:
|
class Meta:
|
||||||
model = User
|
model = User
|
||||||
fields = ["publish_data", "biography", "attending_decision"]
|
fields = ["publish_data", "GPA", "biography", "attending_decision"]
|
||||||
|
|
||||||
help_texts = {
|
help_texts = {
|
||||||
"biography": "ECs, intended major, advice, etc.",
|
"biography": "ECs, intended major, advice, etc.",
|
||||||
|
|
|
@ -34,6 +34,7 @@ class ProfileTest(TJDestsTestCase):
|
||||||
response = self.client.post(
|
response = self.client.post(
|
||||||
reverse("profile:index"),
|
reverse("profile:index"),
|
||||||
data={
|
data={
|
||||||
|
"GPA": 4.000,
|
||||||
"biography": "hello",
|
"biography": "hello",
|
||||||
"attending_decision": "",
|
"attending_decision": "",
|
||||||
"publish_data": False,
|
"publish_data": False,
|
||||||
|
@ -43,6 +44,7 @@ class ProfileTest(TJDestsTestCase):
|
||||||
self.assertEqual(
|
self.assertEqual(
|
||||||
1,
|
1,
|
||||||
User.objects.filter(
|
User.objects.filter(
|
||||||
|
GPA=4.000,
|
||||||
id=user.id,
|
id=user.id,
|
||||||
biography="hello",
|
biography="hello",
|
||||||
attending_decision=None,
|
attending_decision=None,
|
||||||
|
@ -59,6 +61,7 @@ class ProfileTest(TJDestsTestCase):
|
||||||
response = self.client.post(
|
response = self.client.post(
|
||||||
reverse("profile:index"),
|
reverse("profile:index"),
|
||||||
data={
|
data={
|
||||||
|
"GPA": 3.141,
|
||||||
"biography": "hello2",
|
"biography": "hello2",
|
||||||
"attending_decision": decision.id,
|
"attending_decision": decision.id,
|
||||||
"publish_data": True,
|
"publish_data": True,
|
||||||
|
@ -69,6 +72,7 @@ class ProfileTest(TJDestsTestCase):
|
||||||
1,
|
1,
|
||||||
User.objects.filter(
|
User.objects.filter(
|
||||||
id=user.id,
|
id=user.id,
|
||||||
|
GPA=3.141,
|
||||||
biography="hello2",
|
biography="hello2",
|
||||||
attending_decision=decision,
|
attending_decision=decision,
|
||||||
publish_data=True,
|
publish_data=True,
|
||||||
|
@ -88,6 +92,7 @@ class ProfileTest(TJDestsTestCase):
|
||||||
response = self.client.post(
|
response = self.client.post(
|
||||||
reverse("profile:index"),
|
reverse("profile:index"),
|
||||||
data={
|
data={
|
||||||
|
"GPA": 1.234,
|
||||||
"biography": "hello2",
|
"biography": "hello2",
|
||||||
"attending_decision": decision2.id,
|
"attending_decision": decision2.id,
|
||||||
"publish_data": True,
|
"publish_data": True,
|
||||||
|
@ -98,6 +103,7 @@ class ProfileTest(TJDestsTestCase):
|
||||||
1,
|
1,
|
||||||
User.objects.filter(
|
User.objects.filter(
|
||||||
id=user.id,
|
id=user.id,
|
||||||
|
GPA=1.234,
|
||||||
biography="hello2",
|
biography="hello2",
|
||||||
attending_decision=decision,
|
attending_decision=decision,
|
||||||
publish_data=True,
|
publish_data=True,
|
||||||
|
|
|
@ -38,6 +38,7 @@
|
||||||
<thead>
|
<thead>
|
||||||
<tr>
|
<tr>
|
||||||
<th scope="col">Name</th>
|
<th scope="col">Name</th>
|
||||||
|
<th scope="col">GPA</th>
|
||||||
<th scope="col">Test scores</th>
|
<th scope="col">Test scores</th>
|
||||||
<th scope="col">Biography</th>
|
<th scope="col">Biography</th>
|
||||||
<th scope="col">Decisions</th>
|
<th scope="col">Decisions</th>
|
||||||
|
@ -47,6 +48,7 @@
|
||||||
{% for senior in object_list %}
|
{% for senior in object_list %}
|
||||||
<tr>
|
<tr>
|
||||||
<td>{{ senior }}</td>
|
<td>{{ senior }}</td>
|
||||||
|
<td>{{ senior.GPA|stringformat:".3f" }}</td>
|
||||||
<td>
|
<td>
|
||||||
{# Test scores #}
|
{# Test scores #}
|
||||||
<table class="table table-sm">
|
<table class="table table-sm">
|
||||||
|
|
Loading…
Reference in New Issue
Block a user