mirror of
https://gitea.mueller.network/extern/django-helpdesk.git
synced 2024-11-22 07:53:19 +01:00
pycodestyle fixes
This commit is contained in:
parent
bb9d886eea
commit
3d7860b5a3
@ -85,7 +85,7 @@ DATATABLES_ORDER_COLUMN_CHOICES = Choices(
|
|||||||
('6', 'due_date'),
|
('6', 'due_date'),
|
||||||
('7', 'assigned_to'),
|
('7', 'assigned_to'),
|
||||||
('8', 'submitter_email'),
|
('8', 'submitter_email'),
|
||||||
#('9', 'time_spent'),
|
# ('9', 'time_spent'),
|
||||||
('10', 'kbitem'),
|
('10', 'kbitem'),
|
||||||
)
|
)
|
||||||
|
|
||||||
|
@ -66,4 +66,3 @@ class DatatablesTicketSerializer(serializers.ModelSerializer):
|
|||||||
|
|
||||||
def get_kbitem(self, obj):
|
def get_kbitem(self, obj):
|
||||||
return obj.kbitem.title if obj.kbitem else ""
|
return obj.kbitem.title if obj.kbitem else ""
|
||||||
|
|
||||||
|
@ -61,12 +61,13 @@ class QueryTests(TestCase):
|
|||||||
response = self.client.get(reverse('helpdesk:datatables_ticket_list', args=[query]))
|
response = self.client.get(reverse('helpdesk:datatables_ticket_list', args=[query]))
|
||||||
self.assertEqual(
|
self.assertEqual(
|
||||||
response.json(),
|
response.json(),
|
||||||
{"data":
|
{
|
||||||
[{"ticket": "1 [test_queue-1]", "id": 1, "priority": 3, "title": "unassigned to kbitem", "queue": {"title": "Test queue", "id": 1}, "status": "Open", "created": "now", "due_date": None, "assigned_to": "None", "submitter": None, "row_class": "", "time_spent": "", "kbitem": ""},
|
"data":
|
||||||
{"ticket": "2 [test_queue-2]", "id": 2, "priority": 3, "title": "assigned to kbitem", "queue": {"title": "Test queue", "id": 1}, "status": "Open", "created": "now", "due_date": None, "assigned_to": "None", "submitter": None, "row_class": "", "time_spent": "", "kbitem": "KBItem 1"}],
|
[{"ticket": "1 [test_queue-1]", "id": 1, "priority": 3, "title": "unassigned to kbitem", "queue": {"title": "Test queue", "id": 1}, "status": "Open", "created": "now", "due_date": None, "assigned_to": "None", "submitter": None, "row_class": "", "time_spent": "", "kbitem": ""},
|
||||||
"recordsFiltered": 2,
|
{"ticket": "2 [test_queue-2]", "id": 2, "priority": 3, "title": "assigned to kbitem", "queue": {"title": "Test queue", "id": 1}, "status": "Open", "created": "now", "due_date": None, "assigned_to": "None", "submitter": None, "row_class": "", "time_spent": "", "kbitem": "KBItem 1"}],
|
||||||
"recordsTotal": 2,
|
"recordsFiltered": 2,
|
||||||
"draw": 0,
|
"recordsTotal": 2,
|
||||||
|
"draw": 0,
|
||||||
},
|
},
|
||||||
)
|
)
|
||||||
|
|
||||||
@ -78,11 +79,12 @@ class QueryTests(TestCase):
|
|||||||
response = self.client.get(reverse('helpdesk:datatables_ticket_list', args=[query]))
|
response = self.client.get(reverse('helpdesk:datatables_ticket_list', args=[query]))
|
||||||
self.assertEqual(
|
self.assertEqual(
|
||||||
response.json(),
|
response.json(),
|
||||||
{"data":
|
{
|
||||||
[{"ticket": "2 [test_queue-2]", "id": 2, "priority": 3, "title": "assigned to kbitem", "queue": {"title": "Test queue", "id": 1}, "status": "Open", "created": "now", "due_date": None, "assigned_to": "None", "submitter": None, "row_class": "", "time_spent": "", "kbitem": "KBItem 1"}],
|
"data":
|
||||||
"recordsFiltered": 1,
|
[{"ticket": "2 [test_queue-2]", "id": 2, "priority": 3, "title": "assigned to kbitem", "queue": {"title": "Test queue", "id": 1}, "status": "Open", "created": "now", "due_date": None, "assigned_to": "None", "submitter": None, "row_class": "", "time_spent": "", "kbitem": "KBItem 1"}],
|
||||||
"recordsTotal": 1,
|
"recordsFiltered": 1,
|
||||||
"draw": 0,
|
"recordsTotal": 1,
|
||||||
|
"draw": 0,
|
||||||
},
|
},
|
||||||
)
|
)
|
||||||
|
|
||||||
@ -94,10 +96,11 @@ class QueryTests(TestCase):
|
|||||||
response = self.client.get(reverse('helpdesk:datatables_ticket_list', args=[query]))
|
response = self.client.get(reverse('helpdesk:datatables_ticket_list', args=[query]))
|
||||||
self.assertEqual(
|
self.assertEqual(
|
||||||
response.json(),
|
response.json(),
|
||||||
{"data":
|
{
|
||||||
[{"ticket": "2 [test_queue-2]", "id": 2, "priority": 3, "title": "assigned to kbitem", "queue": {"title": "Test queue", "id": 1}, "status": "Open", "created": "now", "due_date": None, "assigned_to": "None", "submitter": None, "row_class": "", "time_spent": "", "kbitem": "KBItem 1"}],
|
"data":
|
||||||
"recordsFiltered": 1,
|
[{"ticket": "2 [test_queue-2]", "id": 2, "priority": 3, "title": "assigned to kbitem", "queue": {"title": "Test queue", "id": 1}, "status": "Open", "created": "now", "due_date": None, "assigned_to": "None", "submitter": None, "row_class": "", "time_spent": "", "kbitem": "KBItem 1"}],
|
||||||
"recordsTotal": 1,
|
"recordsFiltered": 1,
|
||||||
"draw": 0,
|
"recordsTotal": 1,
|
||||||
|
"draw": 0,
|
||||||
},
|
},
|
||||||
)
|
)
|
||||||
|
Loading…
Reference in New Issue
Block a user