Exemplo n.º 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)
Exemplo n.º 2
0
import os
#initialize django environement
os.environ['DJANGO_SETTINGS_MODULE'] = 'fomo.settings'
import django

django.setup()

from account.models import FomoUser

#user 1
user1 = FomoUser()
user1.address = "Provo, UT 84602"
user1.city = "Provo"
user1.gender = "Female"
user1.phone = "801-422-4636"
user1.state = "UTAH"
user1.stateinitial = "UT"
user1.zipcode = "84602"
user1.save()

#user 2
user2 = FomoUser()
user2.address = "Provo, UT 84602"
user2.city = "Provo"
user2.gender = "Female"
user2.phone = "801-422-4636"
user2.state = "UTAH"
user2.stateinitial = "UT"
user2.zipcode = "84602"
user2.save()