Skip to content

Instantly share code, notes, and snippets.

@cordery
cordery / heroku_test_runner.py
Created Apr 24, 2017
Heroku CI compatible DiscoverRunner class for Django 1.10+ that does not require createdb or dropdb permissions.
View heroku_test_runner.py
import os
from django.test.runner import DiscoverRunner
"""
WARNING: WHEN USED INCORRECTLY THIS TEST RUNNER WILL DROP ALL TABLES IN YOUR PRODUCTION
DATABASE!!!
Heroku does not give users createdb/dropdb permissions, therefore Heroku CI cannot run tests for django.
In order to fix this, use this test runner instead which attempts to minimally override the