﻿id	summary	reporter	owner	description	type	status	component	version	severity	resolution	keywords	cc	stage	has_patch	needs_docs	needs_tests	needs_better_patch	easy	ui_ux
27117	The force_login() does not work in a testing if using more one a test	Seti	nobody	"
# test_.py


{{{
from django.test import Client
from django.contrib.auth import get_user_model
from django.core.management import call_command
from django.contrib.staticfiles.testing import StaticLiveServerTestCase


class Tests(StaticLiveServerTestCase):

    @classmethod
    def setUpClass(cls):
        super(Tests, cls).setUpClass()

        call_command('factory_test_superusers', '1')
        cls.active_superuser = get_user_model().objects.get()

    def setUp(self):
        c = Client()
        c.force_login(self.active_superuser)

    def test_1(self):
        pass

    def test_2(self):
        pass
}}}


# run tests

py.test

traceback is here https://bpaste.net/show/36be7958e3d9"	Uncategorized	new	Testing framework	1.9	Normal		Pytest, LiveTests		Unreviewed	0	0	0	0	0	0
