예제 #1
0
 def test_list(self):
     users = []
     for i in range(0, 10):
         users.append(_create_user(username='******' % i))
     MongoSchema.clear_cache_and_init()
     users_from_db = User.list()
     for user in users_from_db:
         self.assertTrue(user in users)
예제 #2
0
파일: test.py 프로젝트: hershaw/mongoschema
 def test_list(self):
     users = []
     for i in range(0, 10):
         users.append(_create_user(username='******' % i))
     MongoSchema.clear_cache_and_init()
     users_from_db = User.list()
     for user in users_from_db:
         self.assertTrue(user in users)
예제 #3
0
 def test_reference_query(self):
     user = _create_user()
     email = self._create_email(user)
     MongoSchema.clear_cache_and_init()
     email_from_query = Email.get(user=user)
     self.assertTrue(email.id == email_from_query.id)
     MongoSchema.clear_cache_and_init()
     email_from_find = [x for x in Email.find(user=user)][0]
     self.assertTrue(email.id == email_from_find.id)
예제 #4
0
파일: test.py 프로젝트: hershaw/mongoschema
 def test_reference_query(self):
     user = _create_user()
     email = self._create_email(user)
     MongoSchema.clear_cache_and_init()
     email_from_query = Email.get(user=user)
     self.assertTrue(email.id == email_from_query.id)
     MongoSchema.clear_cache_and_init()
     email_from_find = [x for x in Email.find(user=user)][0]
     self.assertTrue(email.id == email_from_find.id)
예제 #5
0
def _setUp():
    conn.drop_database(TEST_DB_NAME)
    MongoSchema.clear_cache_and_init()
예제 #6
0
파일: test.py 프로젝트: hershaw/mongoschema
def _setUp():
    conn.drop_database(TEST_DB_NAME)
    MongoSchema.clear_cache_and_init()