Tag Archives: tests

Singleton and Unit Tests

9 Oct

Singletons [1] are considered a cancer for many people, however, while python modules can act very well as singletons they can’t be extended, and then we use a singleton class. I have using singletons classes in two projects, first is django-breadcrumbs, that use singletons to store breadcrumbs and than present it in templates. Another project, […]

Fast post: Mock Logging Handler for python unit tests

6 Oct

Here I’m writing tests for django-data-importer when I found following mock to use in unit tests: Refers to http://stackoverflow.com/questions/899067/how-should-i-verify-a-log-message-when-testing-python-code-under-nose/1049375#1049375