'Test S3Duplicate exceptions for nonexistent fields'

def testExceptions(self):

    assertRaises = self.assertRaises
    item = S3ImportItem(self.job)
    item.table = current.db.dedup_test
    deduplicate = S3Duplicate(primary=('nonexistent',))
    item.id = None
    item.method = item.METHOD.CREATE
    item.data = Storage(name='Test0')
    with assertRaises(SyntaxError):
        deduplicate(item)
    deduplicate = S3Duplicate(secondary=('nonexistent',))
    item.id = None
    item.method = item.METHOD.CREATE
    item.data = Storage(name='Test0')
    with assertRaises(SyntaxError):
        deduplicate(item)
    with assertRaises(TypeError):
        deduplicate = S3Duplicate(primary=(lambda : None))
    with assertRaises(TypeError):
        deduplicate = S3Duplicate(secondary=17)
