Skip to content
This repository was archived by the owner on Apr 16, 2023. It is now read-only.

Conversation

@meshy
Copy link
Owner

@meshy meshy commented Jul 29, 2015

No description provided.

meshy added 5 commits July 30, 2015 00:09
The warning was:

    RemovedInDjango110Warning: You haven't defined a TEMPLATES setting.
    You must do so before upgrading to Django 1.10.
    Otherwise Django will be unable to load templates.
This fixes a deprecation warning:

    RemovedInDjango110Warning: Support for string view arguments
    to url() is deprecated and will be removed in Django 1.10.
    Pass the callable instead.
Replaced with a util from incuna_test_utils.

Deprecation warning was:

    RemovedInDjango110Warning: 'get_all_field_names is an unofficial API
    that has been deprecated. You may be able to replace it with
    'get_fields()'.
@meshy
Copy link
Owner Author

meshy commented Jul 29, 2015

Blocked by #44

@kevinetienne
Copy link
Collaborator

It looks like there're 3 other warnings (2 for django 1.9 and 1 for django 1.10):

/home/travis/build/meshy/django-conman/conman/redirects/handlers.py:7: 
RemovedInDjango19Warning: Default value of 'RedirectView.permanent' 
will change from True to False in Django 1.9. Set an explicit value 
to silence this warning.

  view = views.RouteRedirectView.as_view()
/home/travis/build/meshy/django-conman/conman/redirects/tests/test_handlers.py:17: 
RemovedInDjango19Warning: Default value of 'RedirectView.permanent' 
will change from True to False in Django 1.9. Set an explicit value 
to silence this warning.

  expected = RouteRedirectView.as_view()
/home/travis/build/meshy/django-conman/conman/routes/tests/urls.py:12: 
RemovedInDjango110Warning: Support for string view arguments to url() is deprecated
and will be removed in Django 1.10 (got conman.routes.tests.urls.dummy_view). Pass
the callable instead.

  url(r'^$', view_path),

@meshy
Copy link
Owner Author

meshy commented Jul 30, 2015

Yeah, I wasn't quite sure how to deal with those.

The first two relate to the fact that RouteRedirectView does not explicitly set permanent. As it's set dynamically, I'm not sure what to do.

I could add permanent = None, I suppose, but that seems wrong somehow, as it will be overridden.

I could make it a property, and move the logic out of the get_redirect_url method (as this also seems a little wrong to me).

Alternatively, I could just use a function-based view ;) -- It would be even simpler than it currently is, but wouldn't be extensible. Perhaps the question is: how extensible does this need to be?

@meshy
Copy link
Owner Author

meshy commented Jul 30, 2015

The third warning is a bit harder -- the whole file only exists as a test, but if I replace the path with the callable function, then I need to find a new way to override it.

@meshy
Copy link
Owner Author

meshy commented Jul 30, 2015

Perhaps we just need to run clear_url_caches in the setUp...

@LilyFirefly
Copy link
Collaborator

I think I would set permanent=False on the RouteRedirectView. This will silence the warning by opting in to the default future behaviour. It doesn't really matter that we always explicitly override it later. This might need a comment though.

@meshy
Copy link
Owner Author

meshy commented Jul 30, 2015

I think I would set permanent=False to the RouteRedirectView.

Seems quite reasonable.

@kevinetienne
Copy link
Collaborator

Oh I see! Except using a function (or a lambda) which would return a string, I'm not sure what could be used

meshy added 5 commits July 30, 2015 17:32
Deprecation warning was:

    RemovedInDjango19Warning: Default value of 'RedirectView.permanent' will
    change from True to False in Django 1.9. Set an explicit value to
    silence this warning.
@meshy
Copy link
Owner Author

meshy commented Feb 7, 2016

@kevinetienne @ian-foote I think it might be best to deal with the other warnings in another PR -- you happy with what's here?

@LilyFirefly
Copy link
Collaborator

Nothing looks wrong on a quick scan.

@kevinetienne
Copy link
Collaborator

Looks good to me

@meshy
Copy link
Owner Author

meshy commented Feb 8, 2016

Ta!

meshy added a commit that referenced this pull request Feb 8, 2016
Show and remove deprecation warnings in tests
@meshy meshy merged commit ee0be4a into master Feb 8, 2016
@meshy meshy deleted the fix-warnings branch February 8, 2016 09:35
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants