示例#1
0
 def test_count_KW(self):
     "Count given keywords"
     count = ormmanager.count(User, user_name='bobvilla')
     assert count == 1 
示例#2
0
文件: model.py 项目: jinmingda/rmidb2
def email_is_unique(email):
    "Return True if the email is not yet in the database."
    user_count = count(User, email_address=email)
    pending_count = count(RegistrationPendingUser, email_address=email)
    changed_count = count(RegistrationUserEmailChange, new_email_address=email)
    return not(user_count or pending_count or changed_count)
示例#3
0
 def test_count_noKW(self):
     "Count given no keywords"
     count = ormmanager.count(User)
     assert count == 2
示例#4
0
文件: model.py 项目: jinmingda/rmidb2
def user_name_is_unique(user_name):
    "Return True if the user_name is not yet in the database."
    user_count = count(User, user_name=user_name)
    pending_count = count(RegistrationPendingUser, user_name=user_name)
    return not(user_count or pending_count)