def setUp(self): app = Login.test_client() data = { "firstName": "Lucas", "lastName": "Noblat", "email": "*****@*****.**", "password": "******", "nameStarWars": "Dar" } self.response = app.post('/login', data=data)
def test_login_wangyiyun(self, url, phone_number, password): login = Login(url) login.click_login() login.select_other_login_mode() login.check_privacy_policy_checkout() login.phone_number_login() login.input_phone_number_account(phone_number) login.input_password(password) login.click_login_button() login.close_window()
def user_logout(): return Login.user_logout()
def user_login(): return Login.user_login()
def login(): form = Login() if form.validate_on_submit(): login_user(user) flash('logged in successfully')
password=str(password_counter) user_type='donor' name='' for k in range(5): name+=random.choice(string.ascii_letters) contact='032012'+str(phone_counter) city=random.choice(cities) gender=random.choice(genders) blood_type=random.choice(blood_types) dob=datetime.strptime('1990-04-04','%Y-%m-%d') status_d = random.choice(['Active','Active','Active','Active','Inactive']) #status of donor screening_status=random.choice([True,True,True,True,False]) id=generate_random_id() new_login = Login(id=id,email_id=email,password=password,user_type=user_type) new_user=Donor(id=id, email_id=email, name=name, gender=gender, city=city, blood_type=blood_type, phone_number=contact, date_of_birth=dob, screening_status=screening_status, status = status_d, ) try: db.session.add(new_user) db.session.add(new_login) donor_ids.append(id)
from app import Login, db user = Login('adminese', 'admin12345') db.session.add(user) db.session.commit()
from app import db from app import Login db.create_all() print("***********************************") print("Tables in DB are: "+ str(db.engine.table_names())) # Login ID and Password for Logging In db.session.add(Login(uid='cashier1', passw='password2#')) db.session.commit() print("DB Created Successfully! \nUse ID: cashier1 and Password: password2# to Login as Employee.") print("***********************************")