import itertools
import traceback


class MockDateTime(object):
    def __init__(self, ret):
        try:
            self.ret = iter(ret)
        except TypeError:
            self.ret = iter(itertools.repeat(ret))

    def utcnow(self):
        return next(self.ret)

class MockDateTime(object):
    def __init__(self, ret):
        try:
            self.ret = iter(ret)
        except TypeError:
            self.ret = iter((ret,))

    def utcnow(self):
        try:
            return next(self.ret)
        except StopIteration:
            raise ValueError('No more mock values!')

Raise error in mock if there are not enough mock datetime values
Raise error in mock if there are not enough mock datetime values
