mirror of
https://github.com/netbox-community/netbox.git
synced 2025-07-16 04:02:52 -06:00
Add regression test for #19610
This commit is contained in:
parent
ce90cb7bec
commit
320261432a
26
netbox/vpn/tests/test_tables.py
Normal file
26
netbox/vpn/tests/test_tables.py
Normal file
@ -0,0 +1,26 @@
|
|||||||
|
from django.test import RequestFactory, tag, TestCase
|
||||||
|
|
||||||
|
from vpn.models import TunnelTermination
|
||||||
|
from vpn.tables import TunnelTerminationTable
|
||||||
|
|
||||||
|
|
||||||
|
@tag('regression')
|
||||||
|
class TunnelTerminationTableTest(TestCase):
|
||||||
|
def test_every_orderable_field_does_not_throw_exception(self):
|
||||||
|
terminations = TunnelTermination.objects.all()
|
||||||
|
fake_request = RequestFactory().get("/")
|
||||||
|
disallowed = {
|
||||||
|
'actions',
|
||||||
|
'termination', # TODO: remove this when #19600 is merged
|
||||||
|
}
|
||||||
|
|
||||||
|
orderable_columns = [
|
||||||
|
column.name for column in TunnelTerminationTable(terminations).columns
|
||||||
|
if column.orderable and column.name not in disallowed
|
||||||
|
]
|
||||||
|
|
||||||
|
for col in orderable_columns:
|
||||||
|
for dir in ('-', ''):
|
||||||
|
table = TunnelTerminationTable(terminations)
|
||||||
|
table.order_by = f'{dir}{col}'
|
||||||
|
table.as_html(fake_request)
|
Loading…
Reference in New Issue
Block a user