def setUp(self):
        self._setUpHosts()
        self._setUpAirports()
        self._setUpBadges()
        self._setUpLessons()
        self._setUpRoles()
        self._setUpInstructors()
        self._setUpUsersAndLogin()
        self._setUpTags()

        today = date.today()
        tomorrow = today + timedelta(days=1)

        # Add full-blown events so that we can test merging of everything.
        # Random data such as contact, venue, address, lat/long, URLs or notes
        # were generated with faker (see `fake_database.py` for details).
        self.event_a = Event.objects.create(
            slug='event-a', completed=True, assigned_to=self.harry,
            start=today, end=tomorrow,
            host=self.host_alpha, administrator=self.host_alpha,
            url='http://reichel.com/event-a', reg_key='123456',
            admin_fee=2500, invoice_status='not-invoiced',
            attendance=30, contact='moore.buna@schuppe.info', country='US',
            venue='Modi', address='876 Dot Fork',
            latitude=59.987509, longitude=-51.507076,
            learners_pre='http://reichel.com/learners_pre',
            learners_post='http://reichel.com/learners_post',
            instructors_pre='http://reichel.com/instructors_pre',
            instructors_post='http://reichel.com/instructors_post',
            learners_longterm='http://reichel.com/learners_longterm',
            notes='Voluptates hic aspernatur non aut.'
        )
        self.event_a.tags = Tag.objects.filter(name__in=['LC', 'DC'])
        self.event_a.task_set.create(person=self.harry,
                                     role=Role.objects.get(name='instructor'))
        self.event_a.todoitem_set.create(completed=False,
                                         title='Find instructors', due=today)

        self.event_b = Event.objects.create(
            slug='event-b', completed=False, assigned_to=self.hermione,
            start=today, end=tomorrow + timedelta(days=1),
            host=self.host_beta, administrator=self.host_beta,
            url='http://www.cummings.biz/event-b', reg_key='654321',
            admin_fee=2500, invoice_status='not-invoiced',
            attendance=40, contact='haleigh.schneider@hotmail.com',
            country='GB', venue='Nisi', address='59747 Fernanda Cape',
            latitude=-29.545137, longitude=32.417491,
            learners_pre='http://www.cummings.biz/learners_pre',
            learners_post='http://www.cummings.biz/learners_post',
            instructors_pre='http://www.cummings.biz/instructors_pre',
            instructors_post='http://www.cummings.biz/instructors_post',
            learners_longterm='http://www.cummings.biz/learners_longterm',
            notes='Est qui iusto sapiente possimus consectetur rerum et.'
        )
        self.event_b.tags = Tag.objects.filter(name='SWC')
        # no tasks for this event
        self.event_b.todoitem_set.create(completed=True, title='Test merging',
                                         due=today)

        # some "random" strategy for testing
        self.strategy = {
            'event_a': self.event_a.pk,
            'event_b': self.event_b.pk,
            'id': 'obj_b',
            'slug': 'obj_a',
            'completed': 'obj_b',
            'assigned_to': 'obj_a',
            'start': 'obj_b',
            'end': 'obj_a',
            'host': 'obj_b',
            'administrator': 'obj_a',
            'url': 'obj_b',
            'reg_key': 'obj_a',
            'admin_fee': 'obj_b',
            'invoice_status': 'obj_a',
            'attendance': 'obj_b',
            'country': 'obj_a',
            'latitude': 'obj_b',
            'longitude': 'obj_a',
            'learners_pre': 'obj_b',
            'learners_post': 'obj_a',
            'instructors_pre': 'obj_b',
            'instructors_post': 'obj_a',
            'learners_longterm': 'obj_b',
            'contact': 'obj_a',
            'venue': 'obj_b',
            'address': 'combine',
            'notes': 'obj_a',
            'tags': 'combine',
            'task_set': 'obj_b',
            'todoitem_set': 'obj_a',
        }
        base_url = reverse('events_merge')
        query = urlencode({
            'event_a_0': self.event_a.slug,
            'event_b_0': self.event_b.slug
        })
        self.url = '{}?{}'.format(base_url, query)
dataset/ETHPy150Open swcarpentry/amy/workshops/test/test_event.py/TestEventMerging.setUp/original