I'm following roughly the TDD style as explained in the "Obey the Testing Goat" book: You have a functional test for your (Django, in my case) web app that tests the observable behaviour via the Selenium webdriver. And then once you write a failing functional test for the behavior you want to see, you'll then do the TDD loop to implement that functionality.
Now, the functionality I want to implement involves authenticating via OAuth2 with a REST API. The details probably don't matter, but it's the Adobe Lightroom API in case anyone is curious.
Immediately, I run into a few problems: The OAuth Redirect URI from Adobe doesn't accept localhost, so already using local unit tests for that wouldn't work. But also, I probably don't want to hit a live server with my (frequently run) unit tests.
But even the functional test would be something that first should run locally, and automatic, so the whole messing about with tokens and secrets seems messy.
For the unit tests, I'd be fine mocking out everything. Probably the whole external REST access should be hidden in its own class, and then I just create a dummy version of that class with the same interface. But for the integration test I obviously don't want to mock out everything, but it seems like I have to unless I do all the functional testing on a live server with https endpoint so that Adobe is happy with the OAuth process.
Any good practices and patterns I could use?
EDIT: Someone vote close due to "needs more focus", so maybe the one question I would like to steer the discussion towards is design approaches / testing techniques to deal with "unwieldy" external parts. The fact that it's OAuth in my case is secondary.