Skip to content

Instantly share code, notes, and snippets.

@prestontimmons
Created September 28, 2012 16:19

Revisions

  1. prestontimmons revised this gist Oct 18, 2012. 1 changed file with 1 addition and 0 deletions.
    1 change: 1 addition & 0 deletions gistfile1.py
    Original file line number Diff line number Diff line change
    @@ -18,5 +18,6 @@ def setUp(self):
    def tearDown(self):
    restore_template_loaders()

    @override_settings(LOGIN_URL="/login/")
    def test_view(self):
    request = RequestFactory().get("/")
  2. prestontimmons revised this gist Sep 28, 2012. 1 changed file with 1 addition and 0 deletions.
    1 change: 1 addition & 0 deletions gistfile1.py
    Original file line number Diff line number Diff line change
    @@ -1,3 +1,4 @@
    from django.template import Template
    from django.test import TestCase
    from django.test.client import RequestFactory
    from django.test.utils import (
  3. prestontimmons created this gist Sep 28, 2012.
    21 changes: 21 additions & 0 deletions gistfile1.py
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,21 @@
    from django.test import TestCase
    from django.test.client import RequestFactory
    from django.test.utils import (
    setup_test_template_loader,
    restore_template_loaders,
    override_settings,
    )

    class TemplateTest(TestCase):

    def setUp(self):
    templates = {
    "template.html": Template("content here"),
    }
    setup_test_template_loader(templates)

    def tearDown(self):
    restore_template_loaders()

    def test_view(self):
    request = RequestFactory().get("/")