Esempio n. 1
0
 def test_count_KW(self):
     "Count given keywords"
     count = ormmanager.count(User, user_name='bobvilla')
     assert count == 1 
Esempio n. 2
0
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)
Esempio n. 3
0
 def test_count_noKW(self):
     "Count given no keywords"
     count = ormmanager.count(User)
     assert count == 2
Esempio n. 4
0
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)