Пример #1
0
    def setUp(self):
        super(I18nLangPrefTests, self).setUp()
        # Create one user and save it to the database
        email = '*****@*****.**'
        pwd = 'test_password'
        self.user = UserFactory.build(username='******', email=email)
        self.user.set_password(pwd)
        self.user.save()

        # Create a registration for the user
        RegistrationFactory(user=self.user)

        # Create a profile for the user
        UserProfileFactory(user=self.user)

        # Create the test client
        self.client = Client()

        # Get the login url & log in our user
        try:
            login_url = reverse('login_post')
        except NoReverseMatch:
            login_url = reverse('login')
        self.client.post(login_url, {'email': email, 'password': pwd})

        # Url and site lang vars for tests to use
        self.url = reverse('dashboard')
        self.site_lang = settings.LANGUAGE_CODE
Пример #2
0
    def setUp(self):
        """Setup a test user along with its registration and profile"""
        super(LoginTest, self).setUp()
        self.user = self._create_user(self.username, self.user_email)

        RegistrationFactory(user=self.user)
        UserProfileFactory(user=self.user)

        self.client = Client()
        cache.clear()

        self.url = reverse('login_api')
Пример #3
0
    def setUp(self):
        super(TestPasswordVerificationView, self).setUp()
        self.user = UserFactory.build(username='******', is_active=True)
        self.password = '******'
        self.user.set_password(self.password)
        self.user.save()
        # Create a registration for the user
        RegistrationFactory(user=self.user)

        # Create a profile for the user
        UserProfileFactory(user=self.user)

        # Create the test client
        self.client = Client()
        cache.clear()
        self.url = reverse('verify_password')
Пример #4
0
    def setUp(self):
        """Setup a test user along with its registration and profile"""
        super(LoginTest, self).setUp()
        self.user = UserFactory.build(username=self.username, email=self.user_email)
        self.user.set_password(self.password)
        self.user.save()

        RegistrationFactory(user=self.user)
        UserProfileFactory(user=self.user)

        self.client = Client()
        cache.clear()

        try:
            self.url = reverse('login_post')
        except NoReverseMatch:
            self.url = reverse('login')
Пример #5
0
    def setUp(self):
        # Create one user and save it to the database
        self.user = UserFactory.build(username='******', email='*****@*****.**')
        self.user.set_password('test_password')
        self.user.save()

        # Create a registration for the user
        RegistrationFactory(user=self.user)

        # Create a profile for the user
        UserProfileFactory(user=self.user)

        # Create the test client
        self.client = Client()
        cache.clear()

        # Store the login url
        try:
            self.url = reverse('login_post')
        except NoReverseMatch:
            self.url = reverse('login')
Пример #6
0
 def setUp(self):
     super(ReactivationEmailTests, self).setUp()
     self.user = UserFactory.create()
     self.unregisteredUser = UserFactory.create()
     self.registration = RegistrationFactory.create(user=self.user)
Пример #7
0
 def setUp(self):
     self.user = UserFactory.create()
     self.unregisteredUser = UserFactory.create()
     self.registration = RegistrationFactory.create(user=self.user)
Пример #8
0
 def setUp(self):
     self.user = UserFactory.create()
     self.unregisteredUser = UserFactory.create()
     self.registration = RegistrationFactory.create(user=self.user)
Пример #9
0
 def setUp(self):
     super(ReactivationEmailTests, self).setUp()
     self.user = UserFactory.create()
     self.unregisteredUser = UserFactory.create()
     self.registration = RegistrationFactory.create(user=self.user)