Finding Un-mocked HTTP requests in Python tests with Nose
I'm a big fan of proper unit testing with mocking. So I'm pretty disappointed when we run across a unit that is not only not mocked properly, but results in real-world consequences outside the testing...
View ArticleAbusing Django Rest Framework Part 1: Non-Model Endpoints
When working with Django Rest Framwork a few months back, there were a few road blocks that we ran into. Rest Framwork is awesome with most models for providing a simple CRUD API, in any (or multiple)...
View ArticleAbout
I'm a web developer and homebrewer from Tulsa, OK with an affinity toward open-source. I work primarily in Python, Django, Javascript and and related languages such as CoffeeScript, CSS and Stylus. As...
View ArticleAbusing Django Rest Framework Part 2: Non-rate-based Throttling
Anyone running an API that can be reached by the outside world should most definitely be concerned that someone might pummel their server by making a massive amount of requests to that one endpoint...
View ArticleMocking Context Managers in Python
I've often found Python's context managers to be pretty useful. They make a nice interface that can handle starting and ending of temporary things for you, like opening and closing a file. For example:...
View ArticleUsing Tox with Travis CI to Test Django Apps
Being a fan of good testing, I'm always trying to find ways to improve testing on various projects. Travis CI and Coveralls are really nice ways to set up continuous integration for your open-source...
View ArticleAbusing Django Rest Framework Part 3: Object-level read-only fields
DRF has tools to control access in a few ways. Serializers make it easy to select what fields can be accessed and whether or not they are read-only. Permissions are great for restricting access to...
View ArticleAbusing Django Rest Framework Part 4: Object-level field exclusion
Similar to the object-level readonly field from my previous post, there are some cases where we want to exclude certain fields based on what object the user is trying to access. You could overwrite the...
View ArticleMocking Python's built-in open function
A while back I was working on my podcast client and ran into an issue downloading large files. The root problem was that all of Django's FileField backends store the file (or file-like object) to...
View ArticleClass-based Celery Tasks
Update 2017-11-02: Celery 4 now adivises against inheriting from Task unless you are extending common functionality. However you can still get similar functionality by creating a new class and calling...
View ArticleMocking a property in Python
Anytime I see someone turning an instance method into a property on a Python object, I always have to step back and rethink whether it's really the right thing to do. While properties certain have...
View ArticleKeeping MRO In Mind When Mocking Inherited Methods
So I just spent a couple of hours banging my head on a ridiculous PyMox mocking issue and though I'd share. Here is an example of the existing code. # views.py class MyBaseView(BaseView): def...
View ArticleUnit Testing Recursion in Python
Today I finally figured out the solution to a problem I've been trying to solve for a while. It's kind of hacky and maybe a bad idea, but now I know it's possible. The problem has always been that I'd...
View ArticleSecuring Your Website With Let's Encrypt
Securing Your Website With Let's Encrypt Securing Your Website With Let's Encrypt (In Under 5 Minutes) Jeremy Satterfield http://jsatt.com https://github.com/jsatt @jsatt jsatt@jsatt.com Web developer...
View ArticleSecuring Your Website with Let's Encrypt
This past week I gave a short presentation at the monthly TulsaWebDevs meeting about setting up a secure website using Let's Encrypt. I covered a brief (minimal) overview of how SSL/TLS works and a...
View ArticleManage All the Languages Using Python Virtualenv
A couple of years ago I was working with a couple other languages beside Python and began to get frustrated with their virtualenv equivalents. Not that they were doing anything wrong, just that they...
View ArticlePython Catalog Data Structures
I recently realized I have several open-source projects I'm a maintainer or owner of which I've never really discussed on this site or on social media. Some of these projects have been pretty specific...
View ArticleThe Pains of MySQL Perfomance Under Docker
Over the course of the last several days I've been plagued with a couple pretty massive performance issues running MySQL under Docker(-compose) in our developer environments. Everyone in our office is...
View ArticleResume
I am a full-stack web developer with a focus on best practices and testing to insure quality, readable and efficient code and reliable infrastructure. I enjoy working on civic and community driven...
View Article