def test_compute_id(self):
            # With anonymous WebUser
            with self.web_user(AnonymousUser()) as experiment_user:
                session = experiment_user.session
                self.mox.ReplayAll()
                self.assertEqual(self.analytics._compute_id(experiment_user),
                                 'Session %s' % session.session_key)
                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.assertEqual(self.analytics._compute_id(experiment_user),
                                 user.id % 'User %d')
                self.mox.VerifyAll()

            # With StaticUser
            experiment_user = StaticUser()
            self.assertRaises(IdentificationError,
                              self.analytics._compute_id, experiment_user)
dataset/ETHPy150Open e-loue/django-lean/django_lean/lean_analytics/tests.py/TestKissMetrics.test_compute_id/swapped operands of `%`