Skip to content

Instantly share code, notes, and snippets.

@key
Created April 8, 2015 12:54
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save key/205f6a1b3c5fb2d85ed2 to your computer and use it in GitHub Desktop.
Save key/205f6a1b3c5fb2d85ed2 to your computer and use it in GitHub Desktop.
django test sample
from django.test import TestCase
class SomeAPITestCase(TestCase):
fixtures = [
'fixtures/someapi/user.yaml',
]
def setUp(self):
super(SomeAPITestCase, self).setUp()
from django.contrib.auth.models import User
self.user = User.objects.get(pk=1)
def test_base_ajax_view_success_response(self):
from apps.someapi.api import foobar
self.assertTrue(foobar(self.user))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment