예제 #1
0
    def test_authenticating_users(self):
        """Tests the authentication of users"""
        # Creates the users
        user1 = FomoUser()
        user1.first_name = 'Stephane'
        user1.last_name = 'Akoki'
        user1.set_password('baseball')
        user1.date_joined = datetime.now()
        user1.last_login = datetime.now()
        user1.username = '******'
        user1.email = '*****@*****.**'
        user1.phone = '336-486-4595'
        user1.address = '1960 N Canyon Rd'
        user1.city = 'Provo'
        user1.state = 'Utah'
        user1.zip_code = '84604'
        user1.is_superuser = True
        user1.is_staff = True
        user1.is_active = True
        user1.save()

        #pull back off of the database
        user1auth = authenticate(username=user1.username, password='******')
        u2 = FomoUser.objects.get(username='******')
        self.assertEqual(u2, user1auth)
예제 #2
0
u1 = FomoUser()
u1.first_name = "Stephane"
u1.last_name = "Akoki"
u1.username = "******"
u1.set_password("jeuvideo")
u1.address = "Provo"
u1.zip = '84604'
u1.date_joined = datetime.now()
u1.last_login = datetime.now()
u1.email = "*****@*****.**"
u1.phone_number = "8013863392"
u1.city = "Provo"
u1.state = "UT"
u1.is_staff = True
u1.is_active = True
u1.save()

u2 = FomoUser()
u2.first_name = "Xavier"
u2.last_name = "Akoki"
u2.username = "******"
u2.set_password("jeuvideo")
u2.address = "Draper"
u2.zip = '84604'
u2.date_joined = datetime.now()
u2.last_login = datetime.now()
u2.email = "*****@*****.**"
u2.phone_number = "8013863392"
u2.city = "Provo"
u2.state = "UT"
예제 #3
0
management.call_command('migrate')

from account.models import FomoUser

## USERS ##

u1 = FomoUser()
u1.username = '******'
u1.first_name = 'Colby'
u1.last_name = 'Thomas'
u1.gender = 'Male'
u1.birthdate = date(1994, 6, 16)
u1.email = '*****@*****.**'
u1.password = '******'
u1.is_staff = True
u1.is_active = True
u1.date_joined = datetime.now()
u1.last_login = datetime.now()
u1.save()

u2 = FomoUser()
u2.username = '******'
u2.first_name = 'Marc'
u2.last_name = 'Oelkers'
u2.gender = 'Male'
u2.birthdate = date(1994, 2, 13)
u2.email = '*****@*****.**'
u2.password = '******'
u2.is_staff = True
u2.is_active = True
u2.date_joined = datetime.now()