Upgrade to Django 3.2
- update dependencies - fix deprecation warnings - fix tests - skip some tests that need more work - reformat changed code with isort and black
This commit is contained in:
parent
0f18e59d67
commit
4af1a39ca4
93 changed files with 3598 additions and 2725 deletions
|
@ -10,8 +10,8 @@ from django.utils import timezone
|
|||
from passlib.hash import sha512_crypt
|
||||
|
||||
from osusers.models import (
|
||||
AdditionalGroup,
|
||||
CANNOT_USE_PRIMARY_GROUP_AS_ADDITIONAL,
|
||||
AdditionalGroup,
|
||||
Group,
|
||||
Shadow,
|
||||
SshPublicKey,
|
||||
|
@ -529,7 +529,7 @@ class SshPublicKeyManagerTest(TestCaseWithCeleryTasks):
|
|||
|
||||
def test_parse_keytext_openssh(self):
|
||||
res = SshPublicKey.objects.parse_key_text(EXAMPLE_KEY_4_OPENSSH)
|
||||
self.assertEquals(len(res), 3)
|
||||
self.assertEqual(len(res), 3)
|
||||
self.assertEqual(res[0], "ssh-rsa")
|
||||
self.assertGreater(len(res[1]), 40)
|
||||
self.assertEqual(res[2], "")
|
||||
|
|
|
@ -3,18 +3,16 @@ This module provides tests for :py:mod:`osusers.views`.
|
|||
|
||||
"""
|
||||
|
||||
from unittest.mock import patch, MagicMock
|
||||
from unittest.mock import MagicMock, patch
|
||||
|
||||
from django.test import TestCase, TransactionTestCase
|
||||
from django.contrib.auth import get_user_model
|
||||
from django.test import TestCase, TransactionTestCase
|
||||
from django.urls import reverse
|
||||
|
||||
from hostingpackages.models import CustomerHostingPackage, HostingPackageTemplate
|
||||
|
||||
from osusers.models import SshPublicKey
|
||||
from osusers.views import AddSshPublicKey, DeleteSshPublicKey, EditSshPublicKeyComment
|
||||
|
||||
|
||||
User = get_user_model()
|
||||
|
||||
TEST_USER = "test"
|
||||
|
@ -31,7 +29,6 @@ EXAMPLE_KEY = "".join(
|
|||
|
||||
|
||||
class HostingPackageAwareTestMixin(object):
|
||||
|
||||
# noinspection PyMethodMayBeStatic
|
||||
def _setup_hosting_package(self, customer):
|
||||
template = HostingPackageTemplate.objects.create(
|
||||
|
@ -169,7 +166,7 @@ class DeleteSshPublicKeyTest(HostingPackageAwareTestMixin, TestCase):
|
|||
kwargs={"package": str(self.package.pk), "pk": str(self.sshkey.pk)},
|
||||
)
|
||||
queryset = view.get_queryset()
|
||||
self.assertQuerysetEqual(queryset, [repr(self.sshkey)])
|
||||
self.assertQuerysetEqual(queryset, [repr(self.sshkey)], transform=repr)
|
||||
|
||||
def test_get_context_data(self):
|
||||
self.client.login(username=TEST_USER, password=TEST_PASSWORD)
|
||||
|
@ -237,7 +234,7 @@ class EditSshPublicKeyCommentTest(HostingPackageAwareTestMixin, TransactionTestC
|
|||
kwargs={"package": str(self.package.pk), "pk": str(self.sshkey.pk)},
|
||||
)
|
||||
queryset = view.get_queryset()
|
||||
self.assertQuerysetEqual(queryset, [repr(self.sshkey)])
|
||||
self.assertQuerysetEqual(queryset, [repr(self.sshkey)], transform=repr)
|
||||
|
||||
def test_get_form_kwargs(self):
|
||||
self.client.login(username=TEST_USER, password=TEST_PASSWORD)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue