-
-
Notifications
You must be signed in to change notification settings - Fork 67
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[chores] Encode created and modified to avoid false positives #66
A comparison between a datetime object and a datetime converted to string generates a diff, but there's no real difference in the data, only the python representation differs. Therefore we will now always encode these using the JSONEncoder from REST framework. Related to #66
- Loading branch information
1 parent
88a4c52
commit 6d618e3
Showing
5 changed files
with
57 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
47 changes: 47 additions & 0 deletions
47
tests/openwisp2/sample_network_topology/migrations/0002_json_properties.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
# Generated by Django 3.0.7 on 2020-06-25 18:25 | ||
|
||
import collections | ||
from django.db import migrations | ||
import jsonfield.fields | ||
import rest_framework.utils.encoders | ||
|
||
|
||
class Migration(migrations.Migration): | ||
|
||
dependencies = [ | ||
('sample_network_topology', '0001_initial'), | ||
] | ||
|
||
operations = [ | ||
migrations.AlterField( | ||
model_name='link', | ||
name='properties', | ||
field=jsonfield.fields.JSONField( | ||
blank=True, | ||
default=dict, | ||
dump_kwargs={ | ||
'cls': rest_framework.utils.encoders.JSONEncoder, | ||
'indent': 4, | ||
}, | ||
load_kwargs={'object_pairs_hook': collections.OrderedDict}, | ||
), | ||
), | ||
migrations.AlterField( | ||
model_name='node', | ||
name='addresses', | ||
field=jsonfield.fields.JSONField(blank=True, default=[]), | ||
), | ||
migrations.AlterField( | ||
model_name='node', | ||
name='properties', | ||
field=jsonfield.fields.JSONField( | ||
blank=True, | ||
default=dict, | ||
dump_kwargs={ | ||
'cls': rest_framework.utils.encoders.JSONEncoder, | ||
'indent': 4, | ||
}, | ||
load_kwargs={'object_pairs_hook': collections.OrderedDict}, | ||
), | ||
), | ||
] |