import six


def is_subdict(dict1, dict2):
    """Checks that dict1 is subdict of dict2.

    >>> is_subdict({"a": 1}, {'a': 1, 'b': 1})
    True

    :param dict1: the candidate
    :param dict2: the super dict
    :return: True if all keys from dict1 are present
             and has same value in dict2 otherwise False
    """
    for k, v in six.iteritems(dict1):
        if k not in dict2 or dict2[k] != v:
            return False
    return True