forked from DGNum/gestioCOF
Add helper to check HttpResponse containing csv
This commit is contained in:
parent
c239f28f17
commit
80ca35a4c0
1 changed files with 5 additions and 0 deletions
|
@ -1,3 +1,4 @@
|
||||||
|
import csv
|
||||||
from unittest import mock
|
from unittest import mock
|
||||||
from urllib.parse import parse_qs, urlparse
|
from urllib.parse import parse_qs, urlparse
|
||||||
|
|
||||||
|
@ -92,6 +93,10 @@ class TestCaseMixin:
|
||||||
else:
|
else:
|
||||||
self.assertEqual(actual, expected)
|
self.assertEqual(actual, expected)
|
||||||
|
|
||||||
|
def load_from_csv_response(self, r):
|
||||||
|
decoded = r.content.decode('utf-8')
|
||||||
|
return list(csv.reader(decoded.split('\n')[:-1]))
|
||||||
|
|
||||||
|
|
||||||
class ViewTestCaseMixin(TestCaseMixin):
|
class ViewTestCaseMixin(TestCaseMixin):
|
||||||
"""
|
"""
|
||||||
|
|
Loading…
Add table
Reference in a new issue