Files @ e6fc18e4e15a
Branch filter:

Location: rattail-project/rattail/tests/db/model/test_datasync.py

lance
Add new `RattailConfiguration` class based on python-configuration
# -*- coding: utf-8; -*-

from __future__ import unicode_literals, absolute_import

import six

from rattail.db import model
from ... import DataTestCase


class TestDataSyncChange(DataTestCase):

    def test_unicode(self):
        change = model.DataSyncChange()
        self.assertEqual(six.text_type(change), "(empty)")

        change = model.DataSyncChange(payload_type='Product', payload_key='00074305001321')
        self.assertEqual(six.text_type(change), "Product: 00074305001321")

        change = model.DataSyncChange(payload_type='Product', payload_key='00074305001321', deletion=True)
        self.assertEqual(six.text_type(change), "Product: 00074305001321 (deletion)")