def test_enroll(self):
            import time
            experiment = Experiment.objects.create(name='Experiment')
            user = User.objects.create_user('user', 'user@example.com', 'user')
            tracker = self.mox.CreateMockAnything()
            analytics = Mixpanel(tracker=tracker)
            now = time.gmtime()
            self.mox.StubOutWithMock(time, 'gmtime')
            time.gmtime().AndReturn(now)
            with self.web_user(user) as experiment_user:
                properties = {'time': '%d' % time.mktime(now),
                              'distinct_id': 'User %d' % user.pk,
                              'Experiment': experiment.name,
                              'Group': 'Test'}
                tracker.run(event_name='Enrolled In Experiment',
                            properties=properties)
                self.mox.ReplayAll()
                analytics.enroll(experiment=experiment,
                                 experiment_user=experiment_user,
                                 group_id=Participant.TEST_GROUP)
                self.mox.VerifyAll()
dataset/ETHPy150Open e-loue/django-lean/django_lean/lean_analytics/tests.py/TestMixpanel.test_enroll/original