File tree Expand file tree Collapse file tree 1 file changed +26
-0
lines changed Expand file tree Collapse file tree 1 file changed +26
-0
lines changed Original file line number Diff line number Diff line change
1
+ from django .test import RequestFactory , tag , TestCase
2
+
3
+ from vpn .models import TunnelTermination
4
+ from vpn .tables import TunnelTerminationTable
5
+
6
+
7
+ @tag ('regression' )
8
+ class TunnelTerminationTableTest (TestCase ):
9
+ def test_every_orderable_field_does_not_throw_exception (self ):
10
+ terminations = TunnelTermination .objects .all ()
11
+ fake_request = RequestFactory ().get ("/" )
12
+ disallowed = {
13
+ 'actions' ,
14
+ 'termination' , # TODO: remove this when #19600 is merged
15
+ }
16
+
17
+ orderable_columns = [
18
+ column .name for column in TunnelTerminationTable (terminations ).columns
19
+ if column .orderable and column .name not in disallowed
20
+ ]
21
+
22
+ for col in orderable_columns :
23
+ for dir in ('-' , '' ):
24
+ table = TunnelTerminationTable (terminations )
25
+ table .order_by = f'{ dir } { col } '
26
+ table .as_html (fake_request )
You can’t perform that action at this time.
0 commit comments