def setUp(self):
        self.password_repository = PasswordRepository(test_database_connection())
        self.password_service = PasswordService(self.password_repository)
        self.password_repository.delete_all_passwords()

        self.user_repository = UserRepository(test_database_connection())
        self.user_service = UserService(self.user_repository)

        self.test_user_one = User("test_user_one", "test_pw1")
        self.test_user_two = User("test_user_two", "test_pw2")
        self.user_service.create_user(self.test_user_one)
        self.user_service.create_user(self.test_user_two)
    def setUp(self):
        self.user_repository = UserRepository(test_database_connection())
        self.user_service = UserService(self.user_repository)
        self.user_repository.delete_all()

        self.test_user_one = User('testuser', 'testuser1', 1)
        self.test_user_two = User('secondo', 'testuser2', 2)
Ejemplo n.º 3
0
    def setUp(self):
        # Reset tables users, passwords
        self.password_repository = PasswordRepository(test_database_connection())
        self.user_repository = UserRepository(test_database_connection())
        self.password_repository.delete_all_passwords()
        self.user_repository.delete_all()

        self.test_user_one = User('testiuser', 'testiuser666', 1)
        self.test_user_two = User('secondtestuesr', 'testingggggg', 2)
        self.test_user_one = self.user_repository.create_user(self.test_user_one)
        self.test_user_two = self.user_repository.create_user(self.test_user_two)
        
        self.test_password_one = Password('matti', 'teppo', 'www.vauva.fi')
        self.test_password_two = Password('testpassword', 'testpassword2', 'www.coinbase.com')
        self.test_password_one.set_user_id(self.test_user_one.user_id)
        self.test_password_two.set_user_id(self.test_user_one.user_id)
Ejemplo n.º 4
0
    def setUp(self):
        self.user_repository = UserRepository(test_database_connection())
        self.user_repository.delete_all()

        self.test_user_one = User('test_user_one', 'testpw')
        self.test_user_two = User('test_user_two', 'test')

        self.user_repository.create_user(self.test_user_one)
        self.user_repository.create_user(self.test_user_two)
def initialize_db():
    conn = database_connection()
    test_conn = test_database_connection()

    create_tables(conn)
    create_tables(test_conn)