superset = {'a': 1, 'b': 2}
subset = {'a': 1}
common = {key: superset[key] for key in set(superset.keys()).intersection(
    set(subset.keys()))}
self.assertEqual(common, subset)
How to assert a dict contains another dict without assertDictContainsSubset in python?