I have a model with managed = False.
class SampleModel(models.Model): apple = models.CharField(max_length=30) orange = models.CharField(max_length=3
Execute raw SQL to create the table in the test setup:
from django.db import connection class MyTest(unittest.TestCase): def setUp(self): connection.cursor().execute("CREATE TABLE ...") def tearDown(self): connection.cursor().execute("DROP TABLE ...")