-
Notifications
You must be signed in to change notification settings - Fork 13
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #24 from Symphoria/master
Wrote Tests (Issue #19)
- Loading branch information
Showing
12 changed files
with
57,349 additions
and
127 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -41,3 +41,5 @@ <h5>{{instance}}</h5> | |
|
||
|
||
{%endblock content%} | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -34,6 +34,7 @@ | |
|
||
</div> | ||
|
||
|
||
<!-- </div> | ||
</div> --> | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -39,6 +39,4 @@ | |
|
||
|
||
|
||
|
||
|
||
{% endblock %} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,21 @@ | ||
from django.test import TestCase | ||
from .models import Ranking | ||
from django.urls import reverse | ||
|
||
|
||
# Create your tests here. | ||
def create_ranking_object(username, current_ques, time_started): | ||
""" | ||
Instantiate an object of Ranking model class | ||
""" | ||
return Ranking.objects.create(username=username, currentquestion=current_ques, timestarted=time_started) | ||
|
||
|
||
class RankViewTest(TestCase): | ||
def test_rank_view_for_queryset_length_per_page(self): | ||
""" | ||
The no of queries per page should not exceed 15 | ||
""" | ||
create_ranking_object(username="Symphoria", current_ques="1", time_started="2017-01-20 23:56:06.967625") | ||
response = self.client.get(reverse('website:ranks')) | ||
self.assertIs(len(response.context['object_list']) > 15, False) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters