tethysplatform / tethys

The Tethys Platform main Django website project repository.
http://tethysplatform.org/
BSD 2-Clause "Simplified" License
91 stars 50 forks source link

Fix test for social auth v4.5.4 #1047

Closed sdc50 closed 2 months ago

sdc50 commented 2 months ago

@swainn, @shawncrawley, This fixes a test for compatibility with the latest version of social-auth-core. We need to get this merged so that the tests will pass for all of the other PRs.

The library made a seemingly innocuous change:

from:

value = response.get(name) or details.get(name) or details.get(alias)

to:

value = response.get(name, details.get(name, details.get(alias)))

The problem was that in the first case the details.get would not get evaluated unless response.get(name) returned None. Whereas in the second case it gets evaluated regardless. In our test we had a mock response with a name attribute, but we were not passing details.