Skip to content

Instantly share code, notes, and snippets.

@felipe-prenholato
Created October 9, 2012 05:03
Show Gist options
  • Select an option

  • Save felipe-prenholato/3856723 to your computer and use it in GitHub Desktop.

Select an option

Save felipe-prenholato/3856723 to your computer and use it in GitHub Desktop.
Show how use singletons in tests.
# coding: utf-8
from django.test import TestCase
from breadcrumbs.breadcrumbs import Breadcrumbs
class BreadcrumbsTest(TestCase):
def setUp(self):
# instantiate the singleton
self.breadcrumbs = Breadcrumbs()
def tearDown(self):
# drop the singleton
self.breadcrumbs._drop_it()
del self.breadcrumbs
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment