Files @ bc5447146f6c
Branch filter:

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

lance
docs: refactor importer command docs, per typer
# -*- 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)")