-
Notifications
You must be signed in to change notification settings - Fork 22
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix: Upgrade to Python 3.12 #134
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reviewed 19 of 19 files at r1, all commit messages.
Reviewable status: all files reviewed, 3 unresolved discussions (waiting on @faucomte97)
codeforlife/tests/model_serializer.py
line 128 at r1 (raw file):
data[field] = getattr(value, "id") self.assertEqual(model_to_dict(model), {**model_to_dict(model), **data})
Instead, replace this with
model_dict = {
field: value
for field, value in model.__dict__.items()
if not field.startswith("_")
}
self.assertDictEqual(model_dict | data, model_dict)
Code quote:
self.assertEqual(model_to_dict(model), {**model_to_dict(model), **data})
codeforlife/tests/model_view_set.py
line 748 at r1 (raw file):
(self.assertEqual if contains_subset else self.assertDictEqual)( json_model, serialized_model )
Instead, replace this with
self.assertDictEqual(
serialized_model | json_model if contains_subset else json_model,
serialized_model,
)
Code quote:
(self.assertEqual if contains_subset else self.assertDictEqual)(
json_model, serialized_model
)
codeforlife/tests/model_view_set.py
line 824 at r1 (raw file):
actual_serializer_context, actual_serializer_context | serializer_context, )
Instead, replace this with
self.assertDictEqual(
actual_serializer_context | serializer_context,
actual_serializer_context,
)
Code quote:
self.assertEqual(
actual_serializer_context,
actual_serializer_context | serializer_context,
)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reviewable status: 17 of 19 files reviewed, 3 unresolved discussions (waiting on @SKairinos)
codeforlife/tests/model_serializer.py
line 128 at r1 (raw file):
Previously, SKairinos (Stefan Kairinos) wrote…
Instead, replace this with
model_dict = { field: value for field, value in model.__dict__.items() if not field.startswith("_") } self.assertDictEqual(model_dict | data, model_dict)
Done.
codeforlife/tests/model_view_set.py
line 748 at r1 (raw file):
Previously, SKairinos (Stefan Kairinos) wrote…
Instead, replace this with
self.assertDictEqual( serialized_model | json_model if contains_subset else json_model, serialized_model, )
Done.
codeforlife/tests/model_view_set.py
line 824 at r1 (raw file):
Previously, SKairinos (Stefan Kairinos) wrote…
Instead, replace this with
self.assertDictEqual( actual_serializer_context | serializer_context, actual_serializer_context, )
Done.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reviewed 1 of 2 files at r2, 2 of 3 files at r3, 1 of 1 files at r4, all commit messages.
Reviewable status: complete! all files reviewed, all discussions resolved (waiting on @faucomte97)
This change is