def test_tos_login(self):
        tos = "Agree to these terms"
        TermsOfService.objects.create(active=True,
                                      content=tos)
        res = self.client.post(self.login_url, self.user_details, secure=True)

        #expect to see the tos, in a form with an action to confirm
        self.assertContains(res, tos)
        expected_action = 'action="%s"' % self.tos_url
        self.assertContains(res, expected_action)

        #django-tos doesn't log the user in yet
        self.assertFalse('_auth_user_id' in self.client.session)

        #and submitting 'accept=accept' to the confirm url logs you in
        self.client.post(self.tos_url, {'accept': 'accept'})

        #now we're logged in
        self.assertTrue('_auth_user_id' in self.client.session)
Called when the user clicks save in the content editor.
dataset/ETHPy150Open buildingenergy/buildingenergy-platform/landing/tests.py/UserLoginTest.test_tos_login--crossover with--dataset/ETHPy150Open anandology/pyjamas/addons/TemplatePanel.py/TemplatePanel.onSave