From 64215a3e3268af45de51955213289d4551b62f83 Mon Sep 17 00:00:00 2001 From: jokiefer Date: Thu, 7 Nov 2024 08:31:20 +0100 Subject: [PATCH] document changes --- .vscode/settings.json | 4 ++-- CHANGELOG.rst | 9 +++++++++ README.rst | 5 +++-- atomic_operations/__init__.py | 2 +- tests/settings.py | 1 + tests/test_parsers.py | 4 ++-- tests/test_views.py | 22 ++++++++++------------ 7 files changed, 28 insertions(+), 19 deletions(-) diff --git a/.vscode/settings.json b/.vscode/settings.json index aca899f..a6028be 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -12,8 +12,8 @@ ], "editor.formatOnSave": true, "editor.codeActionsOnSave": { - "source.fixAll": true, - "source.organizeImports": true + "source.fixAll": "explicit", + "source.organizeImports": "explicit" }, "[python]": { "editor.defaultFormatter": "ms-python.autopep8" diff --git a/CHANGELOG.rst b/CHANGELOG.rst index 1c4c66c..d941305 100644 --- a/CHANGELOG.rst +++ b/CHANGELOG.rst @@ -7,6 +7,15 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). +[0.4.0] - 2024-11-07 +-------------------- + +Added +~~~~~ + +* local identity (lid) handling + + [0.3.2] - 2024-10-25 -------------------- diff --git a/README.rst b/README.rst index 1e21f9f..e0264e4 100644 --- a/README.rst +++ b/README.rst @@ -23,10 +23,11 @@ Implemented Features * `Updating To-One Relationships `_ * `Updating To-Many Relationships `_ * error reporting with json pointer to the concrete operation and the wrong attributes - +* `local identity (lid) `_ handling ToDo ~~~~ +Only one major feature need to be implemented for first major version v1.0.0: + * permission handling -* `local identity (lid) `_ handling diff --git a/atomic_operations/__init__.py b/atomic_operations/__init__.py index cce77cc..5022244 100644 --- a/atomic_operations/__init__.py +++ b/atomic_operations/__init__.py @@ -1,2 +1,2 @@ -__version__ = "0.3.2" +__version__ = "0.4.0" VERSION = __version__ # synonym diff --git a/tests/settings.py b/tests/settings.py index 4553984..b46acb4 100644 --- a/tests/settings.py +++ b/tests/settings.py @@ -1,5 +1,6 @@ import os + SECRET_KEY = "SOME_SUPER_SECRET" BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__))) diff --git a/tests/test_parsers.py b/tests/test_parsers.py index 7978405..06cafd6 100644 --- a/tests/test_parsers.py +++ b/tests/test_parsers.py @@ -436,7 +436,7 @@ def test_primary_data_with_id_and_lid(self): "title": "JSON API paints my bikeshed!" } }, - { + { "op": "update", "data": { "lid": "1", @@ -456,4 +456,4 @@ def test_primary_data_with_id_and_lid(self): "stream": stream, "parser_context": self.parser_context } - ) \ No newline at end of file + ) diff --git a/tests/test_views.py b/tests/test_views.py index e9ece15..03d8508 100644 --- a/tests/test_views.py +++ b/tests/test_views.py @@ -23,10 +23,10 @@ def setUp(self): def test_content_type_extension(self): """Test that the correct content type is accepted - + The media type and parameters are defined at https://jsonapi.org/ext/atomic. This tests hardcodes the value to separate the test from the library's constants. - + """ operations = [] @@ -538,7 +538,7 @@ def test_view_processing_with_lid_substitution(self): "text": "JSON API paints my bikeshed!" } } - }, + }, { "op": "add", "data": { @@ -548,7 +548,7 @@ def test_view_processing_with_lid_substitution(self): "text": "JSON API paints my bikeshed!" } } - },{ + }, { "op": "update", "data": { "lid": "valid-lid-1", @@ -675,7 +675,6 @@ def test_view_processing_with_lid_substitution(self): self.assertDictEqual(expected_result, json.loads(response.content)) - # check db content self.assertEqual(1, BasicModel.objects.count()) @@ -693,7 +692,6 @@ def test_view_processing_with_lid_substitution(self): # with django 4.2 TransactionTestCase.assertQuerysetEqual() is deprecated in favor of assertQuerySetEqual(). self.assertQuerySetEqual(RelatedModelTwo.objects.filter(pk__in=[1, 2]), BasicModel.objects.get(pk=2).to_many.all()) - def test_view_processing_with_invalid_lid(self): operations = [ @@ -735,7 +733,7 @@ def test_view_processing_with_invalid_lid(self): error = json.loads(response.content) expected_error = { "errors": [ - { + { "id": "unknown-lid", "detail": f'Object with lid `invalid-lid-test-2` received for operation with index `1` does not exist', "source": { @@ -797,7 +795,7 @@ def test_view_processing_with_lid_type_mismatch(self): error = json.loads(response.content) expected_error = { "errors": [ - { + { "id": "unknown-lid", "detail": f'Object with lid `lid-type-mismatch-1` received for operation with index `2` does not exist', "source": { @@ -821,7 +819,7 @@ def test_adding_resource_with_lid_relationship(self): "text": "JSON API paints my bikeshed!" } }, - }, + }, { "op": "add", "data": { @@ -841,7 +839,7 @@ def test_adding_resource_with_lid_relationship(self): "text": "JSON API paints my bikeshed!" } }, - },{ + }, { "op": "add", "data": { "type": "BasicModel", @@ -869,7 +867,7 @@ def test_adding_resource_with_lid_relationship(self): } } } - }, + }, ] data = { @@ -948,4 +946,4 @@ def test_adding_resource_with_lid_relationship(self): } self.assertDictEqual(expected_result, - json.loads(response.content)) \ No newline at end of file + json.loads(response.content))