-
Notifications
You must be signed in to change notification settings - Fork 126
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
DX: Remove db-diff dependency #288
base: master
Are you sure you want to change the base?
Conversation
def ready(self): | ||
register_serializer('sorted_json', 'cities_light.serializers.json') |
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.
Register an additional serializer where the dbdiff package was overriding the default json serializer.
{ | ||
"fields": { | ||
"alternate_names": "Юргинский район", | ||
"country": [2017370], | ||
"display_name": "Yurginskiy Rayon, Russia", | ||
"geoname_code": "1485714", | ||
"geoname_id": 1485714, | ||
"name": "Yurginskiy Rayon", | ||
"name_ascii": "Yurginskiy Rayon", | ||
"region": [1503900], | ||
"slug": "yurginskiy-rayon" | ||
}, | ||
"model": "cities_light.subregion", | ||
"pk": 1 | ||
}, |
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.
I noticed that this fixture wasn't up to date :/
Do you ser necessary continue with the Remove db-diff? Because know I have access to that repo and could keep updated |
@pfouque ? |
"makemigrations", | ||
"cities_light", | ||
"--dry-run", | ||
"--check", |
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.
Call the real makemigrations command instead of the MigrationLoader.
As it's kind of a public interface it should be more stable (it's also shorter and easier to test out of the tests)
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.
I like it, and some other modifications.
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.
Nice, I will try to move forward and get a stable state.
That would make this package more independent and easier to maintain
Up to you, I started this when it wasn't clear if db-diff would be fixed, and I discovered it was used mainly for a single assert. (If it was my project I would probably incorporate it directly, but up to you) |
Used only for testing, mainly using assertNoDiff only.
It creates some unnecessary back and forth between these 2 repository.
This PR tries to get rid of this dependency so that django-cities-light is more independent