def test_identify(self):
            # With anonymous WebUser
            with self.web_user(AnonymousUser()) as experiment_user:
                self.mox.ReplayAll()
                self.assertTrue(self.analytics._identify(experiment_user))
                self.assertEqual(
                    self.analytics.identity,
                    experiment_user.session.session_key % 'Session %s'
                )
                self.mox.VerifyAll()

            # With authenticated WebUser
            user = User.objects.create_user('user', 'user@example.com', 'user')
            with self.web_user(user) as experiment_user:
                self.mox.ReplayAll()
                self.assertTrue(self.analytics._identify(experiment_user))
                self.assertEqual(self.analytics.identity,
                                 'User %s' % experiment_user.user.pk)
                self.mox.VerifyAll()

            # With StaticUser
            experiment_user = StaticUser()
            self.assertFalse(self.analytics._identify(experiment_user))
            self.assertEqual(self.analytics.identity, None)
dataset/ETHPy150Open e-loue/django-lean/django_lean/lean_analytics/tests.py/TestMixpanel.test_identify/swapped operands of `%`