def stores_should_be_similar(): member_store1 = stores.MemberStore() member_store2 = stores.MemberStore() if member_store1.get_all() is not member_store2.get_all(): print("Generator: are not the same!") if member_store1.members is member_store2.members: print("But lists: are same stores elements !")
def stores_should_be_similar(): print "< Check if stores are similare >" members_store1 = stores.MemberStore() members_store2 = stores.MemberStore() if members_store1.get_all() is members_store2.get_all(): print "Stores are similar" else: print "Stores are not similar" print "=" * 30
from flask import Flask, render_template, request, redirect import models import stores import dummy_data from views import * post_store = stores.PostStore() member_store = stores.MemberStore() if __name__ == "__main__": dummy_data.seed_stores(member_store, post_store) app.run()
def stores_should_be_similar(): member_store1 = stores.MemberStore() member_store2 = stores.MemberStore() if member_store1.get_all() is member_store2.get_all(): print("Same stores elements !")
member2 = models.Member("Azhar", 19) member3 = models.Member("Yososf", 38) post1 = models.Post(member1, "Title 1", "Content 1 Content 1 Content 1") post2 = models.Post(member1, "Title 2", "Content 2 Content 2 Content 2") post3 = models.Post(member2, "Title 3", "Content 3 Content 3 Content 3") print member1 print member2 print member3 print post1 print post2 print post3 store1 = stores.MemberStore() store1.add(member1) store1.add(member2) store1.add(member3) member_store1 = store1.get_all() for m in member_store1: print m print store1.get_by_id(1) print store1.entity_exists(member3) store1.delete(2) print store1.get_by_id(2) print store1.entity_exists(member2)
def stores_similar(): member_store1 = stores.MemberStore() member_store2 = stores.MemberStore() if member_store1.get_all() is member_store2.get_all(): print("same stores")
import models import stores member1 = models.memmber('Ahmed', '20') # member2 = models.memmber('Arafa', '30') add_new_member = stores.MemberStore() add_new_member.add(member1) print add_new_member.get_all() print add_new_member.last_id add_new_member.delete(1) print add_new_member.get_by_id(member1) # post1 = models.Post('x', 'x') # post2 = models.Post('y', 'y') # post3 = models.Post('z', 'z')