Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save maddrum/a86854f7c3d4eec2517ae2163d5cd601 to your computer and use it in GitHub Desktop.
Save maddrum/a86854f7c3d4eec2517ae2163d5cd601 to your computer and use it in GitHub Desktop.
from django.test import TestCase
from path.to.abstract.model import SomeAbstractModel
class SampleModel(SomeAbstractModel):
class Meta:
# app_label is needed in cases where tests are in folder of project to be able to find this model
app_label = 'app.name.of.where.abstract.model.is.defined'
class TestSomeAbstractModel(TestCase):
def test_something(self):
mod, created = SampleModel.objects.create()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment