Exemplo n.º 1
0
    def assert_registration(self, match=None, reset=False):
        if match is None and reset:
            match = "[Weblate] Password reset on Weblate"

        url = self.assert_registration_mailbox(match)

        if self.clear_cookie and "sessionid" in self.client.cookies:
            del self.client.cookies["sessionid"]

        # Verify that cleanup does not break the workflow
        if self.social_cleanup:
            cleanup_social_auth()

        # Confirm account
        response = self.client.get(url, follow=True)
        if reset:
            # Ensure we can set the password
            self.assertRedirects(response, reverse("password_reset"))
            self.assertContains(response, "You can now set new one")
            # Invalid submission
            response = self.client.post(reverse("password_reset"))
            self.assertContains(response, "You can now set new one")
            # Set password
            response = self.client.post(
                reverse("password_reset"),
                {"new_password1": "2pa$$word!", "new_password2": "2pa$$word!"},
                follow=True,
            )
            self.assertContains(response, "Your password has been changed")
        else:
            self.assertRedirects(response, reverse("password"))
        return url
Exemplo n.º 2
0
 def handle(self, *args, **options):
     """Perfom cleanup of Weblate database."""
     cleanup_fulltext()
     cleanup_screenshot_files()
     with transaction.atomic():
         cleanup_social_auth()
     for project in Project.objects.values_list('id', flat=True):
         cleanup_project(project)
     cleanup_suggestions()
Exemplo n.º 3
0
 def handle(self, *args, **options):
     """Perfom cleanup of Weblate database."""
     cleanup_fulltext()
     cleanup_screenshot_files()
     with transaction.atomic():
         cleanup_social_auth()
     for project in Project.objects.values_list('id', flat=True):
         cleanup_project(project)
     cleanup_suggestions()
     cleanup_stale_repos()
     cleanup_old_suggestions()
Exemplo n.º 4
0
 def handle(self, *args, **options):
     """Perfom cleanup of Weblate database."""
     cleanup_screenshot_files()
     with transaction.atomic():
         cleanup_social_auth()
     for project in Project.objects.values_list("id", flat=True):
         cleanup_project(project)
     cleanup_suggestions()
     cleanup_stale_repos()
     cleanup_old_suggestions()
     cleanup_old_comments()
Exemplo n.º 5
0
 def test_cleanup_social_auth(self):
     cleanup_social_auth()
Exemplo n.º 6
0
 def test_cleanup_social_auth(self):
     cleanup_social_auth()