'Test match with primary/secondary field'

def testMatch(self):

    assertEqual = self.assertEqual
    deduplicate = S3Duplicate(primary=('name',), secondary=('secondary',))
    item = S3ImportItem(self.job)
    item.table = current.db.dedup_test
    ids = self.ids
    item.id = None
    item.method = item.METHOD.CREATE
    item.data = Storage(name='Test0')
    deduplicate(item)
    assertEqual(item.id, ids['TEST0'])
    assertEqual(item.method, item.METHOD.UPDATE)
    item.id = None
    item.method = item.METHOD.CREATE
    item.data = Storage(name='Test2', secondary='secondaryX')
    deduplicate(item)
    assertEqual(item.id, ids['TEST2'])
    assertEqual(item.method, item.METHOD.UPDATE)
    item.id = None
    item.method = item.METHOD.CREATE
    item.data = Storage(name='test4', secondary='secondaryX')
    deduplicate(item)
    assertEqual(item.id, None)
    assertEqual(item.method, item.METHOD.CREATE)
    item.id = None
    item.method = item.METHOD.CREATE
    item.data = Storage(name='Test')
    deduplicate(item)
    assertEqual(item.id, None)
    assertEqual(item.method, item.METHOD.CREATE)
