def test_form_invalid_values(self):
        hidden = {
            'event_a': self.event_a.pk,
            'event_b': self.event_b.pk,
        }
        # fields accepting only 2 options: "obj_a" and "obj_b"
        failing = {
            'id': 'combine',
            'slug': 'combine',
            'completed': 'combine',
            'assigned_to': 'combine',
            'start': 'combine',
            'end': 'combine',
            'host': 'combine',
            'administrator': 'combine',
            'url': 'combine',
            'reg_key': 'combine',
            'admin_fee': 'combine',
            'invoice_status': 'combine',
            'attendance': 'combine',
            'country': 'combine',
            'latitude': 'combine',
            'longitude': 'combine',
            'learners_pre': 'combine',
            'learners_post': 'combine',
            'instructors_pre': 'combine',
            'instructors_post': 'combine',
            'learners_longterm': 'combine',
        }
        # fields additionally accepting "combine"
        passing = {
            'tags': 'combine',
            'contact': 'combine',
            'venue': 'combine',
            'address': 'combine',
            'notes': 'combine',
            'task_set': 'combine',
            'todoitem_set': 'combine',
        }
        data = hidden.copy()
        data.update(failing)
        data.update(passing)

        form = EventsMergeForm(data)
        self.assertFalse(form.is_valid())

        for key in failing:
            self.assertIn(key, form.errors)
        for key in passing:
            self.assertNotIn(key, form.errors)

        # make sure no fields are added without this test being updated
        self.assertEqual(set(list(form.fields.keys())), set(list(data.keys())))
Constructor.
dataset/ETHPy150Open swcarpentry/amy/workshops/test/test_event.py/TestEventMerging.test_form_invalid_values--crossover with--dataset/ETHPy150Open GoogleCloudPlatform/datastore-ndb-python/ndb/model.py/IndexState.__new__