File tree 2 files changed +9
-3
lines changed
2 files changed +9
-3
lines changed Original file line number Diff line number Diff line change 6
6
7
7
from tests .testapp .models import ExampleModel
8
8
9
+
9
10
@pytest .fixture
10
11
def api_client ():
11
12
return APIClient ()
@@ -20,8 +21,13 @@ def test_simple_viewset_model(api_client):
20
21
response = api_client .get ("/examples/" )
21
22
22
23
assert response .status_code == 200
23
- assert response .headers ["Content-Type" ] == "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet; charset=utf-8"
24
- assert response .headers ["content-disposition" ] == "attachment; filename=my_export.xlsx"
24
+ assert (
25
+ response .headers ["Content-Type" ]
26
+ == "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet; charset=utf-8"
27
+ )
28
+ assert (
29
+ response .headers ["content-disposition" ] == "attachment; filename=my_export.xlsx"
30
+ )
25
31
26
32
workbook_buffer = io .BytesIO (response .content )
27
33
workbook = load_workbook (workbook_buffer , read_only = True )
Original file line number Diff line number Diff line change 3
3
from .testapp .views import ExampleViewSet
4
4
5
5
router = routers .SimpleRouter ()
6
- router .register (r' examples' , ExampleViewSet )
6
+ router .register (r" examples" , ExampleViewSet )
7
7
8
8
urlpatterns = router .urls
You can’t perform that action at this time.
0 commit comments