Skip to main content
Python Software Foundation 20th Year Anniversary Fundraiser  Donate today!

Simple enhancement to the TestCase which creates user and loggs him in.

Project description

Simple enhancement to the TestCase which creates user and loggs him in.


The full documentation is at


Install Django Logon TestCase:

pip install django-logon-testcase

Use it in your tests:

from django.test import TestCase

from logon_testcase import LogonMixin

class MyTestCase(LogonMixin, TestCase):

The logged user is available in self.user variable.


You can get your own user for the test by overriding get_user function:

class MyTestCase(LogonMixin):
     def get_user(self):
         return User.objects.create()

Running Tests

Does the code actually work?

source <YOURVIRTUALENV>/bin/activate
(myenv) $ pip install tox
(myenv) $ tox


Tools used in rendering this package:


0.1.0 (2017-08-10)

  • First release on PyPI.

Project details

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Files for django-logon-testcase, version 0.1.1
Filename, size File type Python version Upload date Hashes
Filename, size django-logon-testcase-0.1.1.tar.gz (14.9 kB) File type Source Python version None Upload date Hashes View

Supported by

AWS AWS Cloud computing Datadog Datadog Monitoring DigiCert DigiCert EV certificate Facebook / Instagram Facebook / Instagram PSF Sponsor Fastly Fastly CDN Google Google Object Storage and Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Salesforce Salesforce PSF Sponsor Sentry Sentry Error logging StatusPage StatusPage Status page