'Takes elements in the transaction\'s temporary storage and adds them
to the mock graph\'s storage. Throws an error if the graph\'s
transaction_errors param is set to True.'

def commit(self):

    if self.graph.transaction_errors:
        raise Exception(u'fake    exception    while    trying    to    commit')
    for element in self.temp:
        self.graph.nodes.add(element)
    self.temp.clear()
    self.graph.number_commits += 1
