예제 #1
0
    def test_get_event_for_creates_modify(self):
        new_data = fixtures.get_data_fixture()
        old_data = fixtures.get_entity_fixture(fixtures.get_data_fixture())
        modifications = [{'key': 'value'}]

        event = events.get_event_for(old_data, new_data, modifications)
        self.assertEqual(event["event"], "MODIFY")
예제 #2
0
    def test_get_event_for_creates_delete(self):
        new_data = None
        old_data = fixtures.get_entity_fixture(fixtures.get_data_fixture())
        modifications = []

        event = events.get_event_for(old_data, new_data, modifications)
        self.assertEqual(event["event"], "DELETE")
예제 #3
0
    def test_get_event_for_creates_confirm(self):
        new_data = fixtures.get_data_fixture()
        old_data = fixtures.get_entity_fixture(new_data)
        modifications = []

        event = events.get_event_for(old_data, new_data, modifications)
        self.assertEqual(event["event"], "CONFIRM")
예제 #4
0
    def test_get_event_for_creates_add(self):
        old_data = None
        new_data = fixtures.get_data_fixture()
        modifications = []

        event = events.get_event_for(old_data, new_data, modifications)
        self.assertEqual(event["event"], "ADD")