'Verify that the dict superset contains the dict subset.
Works like assertDictContainsSubset, deprecated since Python 3.2.
See: https://docs.python.org/2.7/library/unittest.html#unittest.TestCase.assertDictContainsSubset.'

def assert_dict_contains_subset(self, superset, subset):

    superset_keys = set(superset.keys())
    subset_keys = set(subset.keys())
    intersection = {key: superset[key] for key in (superset_keys & subset_keys)}
    self.assertEqual(subset, intersection)
