I set up my main project at work to utilize LocalStack this week. I wasn't able to get it working using a virtual environment with Python, but another project at work has it set up through Docker. A coworker that is much more familiar with Docker than I am helped …
-
-
[TIL] Using Fixtures with pytest `parametrize`
For longer than I care to admit, I was running my end to end tests in only Firefox. I thought it would be trivial to add a fixture to have my tests run using multiple browsers. Unfortunately, there isn't an easy way in
pytest
to use fixtures as parametrized values … -
[TIL] Mocking Chained Calls
At work last week, I was asked to write tests for code that reaches out to Twilio's verify service. Here is what that code looks like (from the Twilio docs):
client = Client(account_sid, auth_token) verification = client.verify \ .v2 \ .services('VAXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') \ .verifications \ .create(to='+15017122661', channel='sms')
I was able to …
-
[TIL] Django Admin Permissions, etc.
So far in my main project (more on that to come), the only users of the admin have been myself and my cofounder, so I've made us both superusers. Recently, I had a request to allow an instructor to view and update data from their own courses. This would require …