berinhard/model_mommy

RemovedInDjango20Warning on Django 1.11

dbrgn opened this issue · 5 comments

dbrgn commented

Running model mommy on Django 1.11 with warnings turned on (-Wd) yields this:

lib/python3.5/site-packages/model_mommy/mommy.py:392: RemovedInDjango20Warning: Usage of field.rel has been deprecated. Use field.remote_field instead.

#318 address this. You may take a look there.

I see this issue was worked on in a different PR and ticket, but I think this is still an issue.

Warnings don't really bother too much, but I have almost 5K lines of warnings coming in through our CI for each test run right now.

They mostly look like this:

/{path}/.tox/py36/lib/python3.6/site-packages/model_mommy/mommy.py:390: RemovedInDjango20Warning: Usage of ForeignObjectRel.to attribute has been deprecated. Use the model attribute instead.
--
  | elif isinstance(field, ForeignKey) and issubclass(self._remote_field(field).to, ContentType):


This is running model-mommy==1.4.0

Argh.
Thanks for the report. I thought we got rid of it.

@vandersonmota

I actually went to go send a PR on this, but then noticed it's already been fixed in master here:

6656716

It must have been snuck in right after you tagged the 1.4.0.

Is there anyway you can release a 1.4.1 to include that? If you'd rather wait, it's fine, I can just target that hash above in requirements.txt.

Closing this because it has already been fixed and released with 1.4.1 version. See the changelog for more info.