Skip to content

Commit 8e8b861

Browse files
committed
Handle newlines consistently in Django@main too
1 parent 0067b08 commit 8e8b861

File tree

2 files changed

+1
-8
lines changed

2 files changed

+1
-8
lines changed

feincms3_data/data.py

+1-2
Original file line numberDiff line numberDiff line change
@@ -100,8 +100,7 @@ def dump_specs(specs, *, mappers=None, objects=None):
100100
_model_queryset(spec).distinct() for spec in specs
101101
)
102102
serializer.serialize(objects, stream=stream)
103-
stream.write("}\n")
104-
return stream.getvalue()
103+
return stream.getvalue().rstrip("\n") + "}\n"
105104

106105

107106
def load_dump(

tests/testapp/test_data.py

-6
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
11
import json
2-
from unittest import skipIf
32

4-
import django
53
from django.db import models
64
from django.test import TransactionTestCase
75

@@ -647,10 +645,6 @@ def test_mti(self):
647645
],
648646
)
649647

650-
@skipIf(
651-
django.VERSION > (6,),
652-
"Django changed the JSON dump format to include a final newline.",
653-
)
654648
def test_json_format(self):
655649
"""The exact format generated by dump_specs shouldn't change without us noticing"""
656650

0 commit comments

Comments
 (0)