Changeset - 3d85857ea1a1
[Not reviewed]
0 1 0
Lance Edgar (lance) - 4 years ago 2020-07-19 20:11:14
lance@edbob.org
Fix a test per recent importer change
1 file changed with 6 insertions and 1 deletions:
0 comments (0 inline, 0 general)
rattail/tests/importing/test_importers.py
Show inline comments
 
@@ -181,25 +181,30 @@ class TestImporter(TestCase):
 

	
 
    def test_get_deletion_keys(self):
 
        importer = importers.Importer()
 
        self.assertFalse(importer.caches_local_data)
 
        keys = importer.get_deletion_keys()
 
        self.assertEqual(keys, set())
 

	
 
        importer.caches_local_data = True
 
        self.assertIsNone(importer.cached_local_data)
 
        keys = importer.get_deletion_keys()
 
        self.assertEqual(keys, set())
 

	
 
        importer.cached_local_data = {'delete-me': object()}
 
        importer.cached_local_data = {
 
            'delete-me': {
 
                'object': object(),
 
                'data': {},
 
            },
 
        }
 
        keys = importer.get_deletion_keys()
 
        self.assertEqual(keys, set(['delete-me']))
 

	
 
    def test_model_name_attr(self):
 
        # default is None
 
        importer = importers.Importer()
 
        self.assertIsNone(importer.model_name)
 

	
 
        # but may be overridden via init kwarg
 
        importer = importers.Importer(model_name='Foo')
 
        self.assertEqual(importer.model_name, 'Foo')
 

	
0 comments (0 inline, 0 general)