Merge pull request #961 from bookwyrm-social/django-3-2
Update to django 3.2
This commit is contained in:
commit
ce0e90d472
|
@ -34,6 +34,8 @@ LOCALE_PATHS = [
|
||||||
os.path.join(BASE_DIR, "locale"),
|
os.path.join(BASE_DIR, "locale"),
|
||||||
]
|
]
|
||||||
|
|
||||||
|
DEFAULT_AUTO_FIELD = "django.db.models.AutoField"
|
||||||
|
|
||||||
# Quick-start development settings - unsuitable for production
|
# Quick-start development settings - unsuitable for production
|
||||||
# See https://docs.djangoproject.com/en/2.0/howto/deployment/checklist/
|
# See https://docs.djangoproject.com/en/2.0/howto/deployment/checklist/
|
||||||
|
|
||||||
|
|
|
@ -26,20 +26,23 @@ class BaseModel(TestCase):
|
||||||
outbox="https://example.com/users/rat/outbox",
|
outbox="https://example.com/users/rat/outbox",
|
||||||
)
|
)
|
||||||
|
|
||||||
|
class BookWyrmTestModel(base_model.BookWyrmModel):
|
||||||
|
"""just making it not abstract"""
|
||||||
|
|
||||||
|
self.test_model = BookWyrmTestModel()
|
||||||
|
|
||||||
def test_remote_id(self):
|
def test_remote_id(self):
|
||||||
"""these should be generated"""
|
"""these should be generated"""
|
||||||
instance = base_model.BookWyrmModel()
|
self.test_model.id = 1
|
||||||
instance.id = 1
|
expected = self.test_model.get_remote_id()
|
||||||
expected = instance.get_remote_id()
|
self.assertEqual(expected, "https://%s/bookwyrmtestmodel/1" % DOMAIN)
|
||||||
self.assertEqual(expected, "https://%s/bookwyrmmodel/1" % DOMAIN)
|
|
||||||
|
|
||||||
def test_remote_id_with_user(self):
|
def test_remote_id_with_user(self):
|
||||||
"""format of remote id when there's a user object"""
|
"""format of remote id when there's a user object"""
|
||||||
instance = base_model.BookWyrmModel()
|
self.test_model.user = self.local_user
|
||||||
instance.user = self.local_user
|
self.test_model.id = 1
|
||||||
instance.id = 1
|
expected = self.test_model.get_remote_id()
|
||||||
expected = instance.get_remote_id()
|
self.assertEqual(expected, "https://%s/user/mouse/bookwyrmtestmodel/1" % DOMAIN)
|
||||||
self.assertEqual(expected, "https://%s/user/mouse/bookwyrmmodel/1" % DOMAIN)
|
|
||||||
|
|
||||||
def test_set_remote_id(self):
|
def test_set_remote_id(self):
|
||||||
"""this function sets remote ids after creation"""
|
"""this function sets remote ids after creation"""
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
celery==4.4.2
|
celery==4.4.2
|
||||||
Django==3.1.8
|
Django==3.2.0
|
||||||
django-model-utils==4.0.0
|
django-model-utils==4.0.0
|
||||||
environs==7.2.0
|
environs==7.2.0
|
||||||
flower==0.9.4
|
flower==0.9.4
|
||||||
|
|
Loading…
Reference in New Issue