1
1
import django .template as django_template
2
2
from django .template .engine import Engine
3
3
from django .template .response import SimpleTemplateResponse
4
- from django .urls import reverse
5
4
from django .test import TestCase
5
+ from django .urls import reverse
6
6
7
7
from . import models
8
8
@@ -49,7 +49,7 @@ def setUp(self):
49
49
models .SecretFile .objects .create (filename = "bar.txt" , order = 2 , size = 512 )
50
50
51
51
def test_sorting_nulls_first (self ):
52
- """ Verify None sorted field_name is in firsts places when sorting in asc and desc order """
52
+ """Verify None sorted field_name is in first places when sorting in asc and desc order"""
53
53
54
54
models .SecretFile .objects .create (filename = None , order = 3 , size = 512 )
55
55
# asc order
@@ -69,7 +69,7 @@ def test_sorting_nulls_first(self):
69
69
self .assertQuerysetEqual (list (response .context ["secret_files" ]), values )
70
70
71
71
def test_sorting_nulls_last (self ):
72
- """ Verify None sorted field_name is in lasts places when sorting in asc and desc order """
72
+ """Verify None sorted field_name is in last places when sorting in asc and desc order. """
73
73
74
74
models .SecretFile .objects .create (filename = None , order = 3 , size = 512 )
75
75
# asc order
@@ -89,7 +89,7 @@ def test_sorting_nulls_last(self):
89
89
self .assertQuerysetEqual (list (response .context ["secret_files" ]), values )
90
90
91
91
def test_sorting_nulls_first_and_last (self ):
92
- """ Verify nulls_first and nulls_last autosort params can't be used at the same time """
92
+ """Verify nulls_first and nulls_last autosort params can't be used at the same time"""
93
93
94
94
engine = Engine (
95
95
libraries = {'sorting_tags' : 'webstack_django_sorting.templatetags.sorting_tags' },
@@ -100,7 +100,7 @@ def test_sorting_nulls_first_and_last(self):
100
100
{% load sorting_tags %}
101
101
{% autosort secret_files nulls_first=True nulls_last=True %}
102
102
""" )
103
- response = SimpleTemplateResponse (
103
+ SimpleTemplateResponse (
104
104
template ,
105
105
context = {'secret_files' : models .SecretFile .objects .all ()}
106
106
)
0 commit comments