Skip to content

Instantly share code, notes, and snippets.

@tingletech
Created May 6, 2015 02:06
Show Gist options
  • Save tingletech/c1f8218715b292824b2a to your computer and use it in GitHub Desktop.
Save tingletech/c1f8218715b292824b2a to your computer and use it in GitHub Desktop.
from django.contrib.auth.models import AnonymousUser, User
from django.test import TestCase, RequestFactory
from .views import search
class SimpleTest(TestCase):
def setUp(self):
# Every test needs access to the request factory.
self.factory = RequestFactory()
def test_details(self):
request = self.factory.get('/', { 'q':'' })
response = search(request)
print(response)
self.assertEqual(response.status_code, 200)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment