Could that be `kwargs[self.username_key]` instead? The username_key isn't set in your custom test backend so the warning says "Username was 'None'". Your TestCustomBackend needs `username_key = 'secret'`, using `kwargs[]` instead of `.get` would make the error more obvious.