mirror of
https://github.com/paperless-ngx/paperless-ngx.git
synced 2025-08-12 00:19:48 +00:00
Fix: correct serializing of auth tokens for export (#8100)
This commit is contained in:
@@ -8,6 +8,9 @@ from pathlib import Path
|
||||
from unittest import mock
|
||||
from zipfile import ZipFile
|
||||
|
||||
from allauth.socialaccount.models import SocialAccount
|
||||
from allauth.socialaccount.models import SocialApp
|
||||
from allauth.socialaccount.models import SocialToken
|
||||
from django.contrib.auth.models import Group
|
||||
from django.contrib.auth.models import Permission
|
||||
from django.contrib.contenttypes.models import ContentType
|
||||
@@ -874,6 +877,23 @@ class TestCryptExportImport(
|
||||
password="mypassword",
|
||||
)
|
||||
|
||||
app = SocialApp.objects.create(
|
||||
provider="test",
|
||||
name="test",
|
||||
client_id="test",
|
||||
)
|
||||
account = SocialAccount.objects.create(
|
||||
user=User.objects.first(),
|
||||
provider="test",
|
||||
uid="test",
|
||||
)
|
||||
SocialToken.objects.create(
|
||||
app=app,
|
||||
account=account,
|
||||
token="test",
|
||||
token_secret="test",
|
||||
)
|
||||
|
||||
call_command(
|
||||
"document_exporter",
|
||||
"--no-progress-bar",
|
||||
@@ -912,6 +932,9 @@ class TestCryptExportImport(
|
||||
self.assertIsNotNone(account)
|
||||
self.assertEqual(account.password, "mypassword")
|
||||
|
||||
social_token = SocialToken.objects.first()
|
||||
self.assertIsNotNone(social_token)
|
||||
|
||||
def test_import_crypt_no_passphrase(self):
|
||||
"""
|
||||
GIVEN:
|
||||
|
Reference in New Issue
Block a user