Ejemplo n.º 1
0
def populate_db():
    session = Session()

    gdg_host = Place(city='Gotham', name='Superheroes', show='1')
    session.add(gdg_host)

    vasia_pupkin = Admin(email='*****@*****.**', godmode=True,
                         place=gdg_host.id)

    session.add(vasia_pupkin)
    session.commit()
Ejemplo n.º 2
0
    def test_constructor(self):

        session = Session()

        user = User(displayname=u"alice in wonderland",
                    email=u"*****@*****.**",
                    password=u"wonderlandpass",
                    sex=u"m",
                    date_of_birth=date.today())

        session.add(user)
        session.commit()
Ejemplo n.º 3
0
    def test_constructor(self):

        session = Session()

        user = User(displayname='alice in wonderland',
                    email='*****@*****.**',
                    password='******',
                    sex='m',
                    date_of_birth=date.today())

        session.add(user)
        session.commit()
Ejemplo n.º 4
0
    def test_constructor(self):

        session = Session()

        user = User(displayname="alice in wonderland",
                    email="*****@*****.**",
                    password="******",
                    sex="m",
                    date_of_birth=date.today())

        session.add(user)
        session.commit()
Ejemplo n.º 5
0
    def test_constructor(self):

        session = Session()

        user = User(nickname='alice',
                    name='Alice',
                    surname='Johns',
                    email='*****@*****.**',
                    gender='female')

        session.add(user)
        session.commit()
Ejemplo n.º 6
0
    def test_passwords(self):

        session = Session()

        user = User(displayname=u"displayname",
                    email=u"*****@*****.**",
                    sex=u"m",
                    date_of_birth=date(1980, 1, 1))
        user.password = u"password"
        session.add(user)
        session.commit()

        self.assertTrue(user.validate_password(u"password"))
        from base64 import b64decode
        self.assertEqual(user._User__encrypt_password(u"password", b64decode(user.salt)), user.password)
Ejemplo n.º 7
0
    def test_passwords(self):

        session = Session()

        user = User(displayname=u"displayname",
                    email=u"*****@*****.**",
                    sex=u"m",
                    date_of_birth=date(1980, 1, 1))
        user.password = u"password"
        session.add(user)
        session.commit()

        self.assertTrue(user.validate_password(u"password"))
        from base64 import b64decode
        self.assertEqual(user._User__encrypt_password(u"password", b64decode(user.salt)), user.password)
Ejemplo n.º 8
0
    def test_passwords(self):

        session = Session()

        user = User(displayname='displayname',
                    email='*****@*****.**',
                    sex='m',
                    date_of_birth=date(1980, 1, 1))
        user.password = '******'
        session.add(user)
        session.commit()

        self.assertTrue(user.validate_password('password'))
        from base64 import b64decode
        self.assertEqual(
            user._User__encrypt_password('password', b64decode(user.salt)),
            user.password)
Ejemplo n.º 9
0
def populate_db():
    session = Session()

    alice = User(displayname='alice',
                 email='*****@*****.**',
                 password='******',
                 sex='f',
                 phone="23452342",
                 birthday=date(1985, 3, 26))

    bob = User(displayname='bob',
               email='*****@*****.**',
               password='******',
               sex='m',
               phone="99990000",
               birthday=date(1978, 4, 27))

    session.add(alice)
    session.add(bob)
    session.commit()