mirror of
https://github.com/bookwyrm-social/bookwyrm.git
synced 2024-11-25 11:01:12 +00:00
Corrects references in tests
This commit is contained in:
parent
3aa9c3accf
commit
13a8bb45af
6 changed files with 37 additions and 9 deletions
2
.gitignore
vendored
2
.gitignore
vendored
|
@ -10,6 +10,6 @@
|
||||||
*.db
|
*.db
|
||||||
*.db-journal
|
*.db-journal
|
||||||
|
|
||||||
# Fedireads
|
# BookWyrm
|
||||||
.env
|
.env
|
||||||
/images/
|
/images/
|
||||||
|
|
28
bookwyrm/migrations/0046_auto_20200921_1509.py
Normal file
28
bookwyrm/migrations/0046_auto_20200921_1509.py
Normal file
|
@ -0,0 +1,28 @@
|
||||||
|
# Generated by Django 3.0.7 on 2020-09-21 15:09
|
||||||
|
|
||||||
|
from django.db import migrations, models
|
||||||
|
|
||||||
|
|
||||||
|
class Migration(migrations.Migration):
|
||||||
|
|
||||||
|
dependencies = [
|
||||||
|
('bookwyrm', '0045_merge_20200810_2010'),
|
||||||
|
]
|
||||||
|
|
||||||
|
operations = [
|
||||||
|
migrations.RenameField(
|
||||||
|
model_name='user',
|
||||||
|
old_name='fedireads_user',
|
||||||
|
new_name='bookwyrm_user',
|
||||||
|
),
|
||||||
|
migrations.AlterField(
|
||||||
|
model_name='connector',
|
||||||
|
name='connector_file',
|
||||||
|
field=models.CharField(choices=[('openlibrary', 'Openlibrary'), ('self_connector', 'Self Connector'), ('bookwyrm_connector', 'Bookwyrm Connector')], max_length=255),
|
||||||
|
),
|
||||||
|
migrations.AlterField(
|
||||||
|
model_name='sitesettings',
|
||||||
|
name='name',
|
||||||
|
field=models.CharField(default='1d8390fd.ngrok.io', max_length=100),
|
||||||
|
),
|
||||||
|
]
|
|
@ -77,9 +77,9 @@ WSGI_APPLICATION = 'bookwyrm.wsgi.application'
|
||||||
# Database
|
# Database
|
||||||
# https://docs.djangoproject.com/en/2.0/ref/settings/#databases
|
# https://docs.djangoproject.com/en/2.0/ref/settings/#databases
|
||||||
|
|
||||||
FEDIREADS_DATABASE_BACKEND = env('FEDIREADS_DATABASE_BACKEND', 'postgres')
|
BOOKWYRM_DATABASE_BACKEND = env('BOOKWYRM_DATABASE_BACKEND', 'postgres')
|
||||||
|
|
||||||
FEDIREADS_DBS = {
|
BOOKWYRM_DBS = {
|
||||||
'postgres': {
|
'postgres': {
|
||||||
'ENGINE': 'django.db.backends.postgresql_psycopg2',
|
'ENGINE': 'django.db.backends.postgresql_psycopg2',
|
||||||
'NAME': env('POSTGRES_DB', 'fedireads'),
|
'NAME': env('POSTGRES_DB', 'fedireads'),
|
||||||
|
@ -95,7 +95,7 @@ FEDIREADS_DBS = {
|
||||||
}
|
}
|
||||||
|
|
||||||
DATABASES = {
|
DATABASES = {
|
||||||
'default': FEDIREADS_DBS[FEDIREADS_DATABASE_BACKEND]
|
'default': BOOKWYRM_DBS[BOOKWYRM_DATABASE_BACKEND]
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -7,7 +7,7 @@ from bookwyrm.connectors.abstract_connector import Mapping,\
|
||||||
from bookwyrm.connectors.bookwyrm_connector import Connector
|
from bookwyrm.connectors.bookwyrm_connector import Connector
|
||||||
|
|
||||||
|
|
||||||
class FedireadsConnector(TestCase):
|
class BookWyrmConnector(TestCase):
|
||||||
def setUp(self):
|
def setUp(self):
|
||||||
self.book = models.Edition.objects.create(title='Example Edition')
|
self.book = models.Edition.objects.create(title='Example Edition')
|
||||||
|
|
||||||
|
|
|
@ -9,7 +9,7 @@ from bookwyrm.connectors.bookwyrm_connector import Connector
|
||||||
from bookwyrm.connectors.abstract_connector import SearchResult, get_date
|
from bookwyrm.connectors.abstract_connector import SearchResult, get_date
|
||||||
|
|
||||||
|
|
||||||
class FedireadsConnector(TestCase):
|
class BookWyrmConnector(TestCase):
|
||||||
def setUp(self):
|
def setUp(self):
|
||||||
models.Connector.objects.create(
|
models.Connector.objects.create(
|
||||||
identifier='example.com',
|
identifier='example.com',
|
||||||
|
|
|
@ -2,13 +2,13 @@
|
||||||
from django.test import TestCase
|
from django.test import TestCase
|
||||||
|
|
||||||
from bookwyrm import models
|
from bookwyrm import models
|
||||||
from bookwyrm.models.base_model import FedireadsModel
|
from bookwyrm.models.base_model import BookWyrmModel
|
||||||
from bookwyrm.settings import DOMAIN
|
from bookwyrm.settings import DOMAIN
|
||||||
|
|
||||||
|
|
||||||
class BaseModel(TestCase):
|
class BaseModel(TestCase):
|
||||||
def test_remote_id(self):
|
def test_remote_id(self):
|
||||||
instance = FedireadsModel()
|
instance = BookWyrmModel()
|
||||||
instance.id = 1
|
instance.id = 1
|
||||||
expected = instance.get_remote_id()
|
expected = instance.get_remote_id()
|
||||||
self.assertEqual(expected, 'https://%s/bookwyrmmodel/1' % DOMAIN)
|
self.assertEqual(expected, 'https://%s/bookwyrmmodel/1' % DOMAIN)
|
||||||
|
@ -16,7 +16,7 @@ class BaseModel(TestCase):
|
||||||
def test_remote_id_with_user(self):
|
def test_remote_id_with_user(self):
|
||||||
user = models.User.objects.create_user(
|
user = models.User.objects.create_user(
|
||||||
'mouse', 'mouse@mouse.com', 'mouseword')
|
'mouse', 'mouse@mouse.com', 'mouseword')
|
||||||
instance = FedireadsModel()
|
instance = BookWyrmModel()
|
||||||
instance.user = user
|
instance.user = user
|
||||||
instance.id = 1
|
instance.id = 1
|
||||||
expected = instance.get_remote_id()
|
expected = instance.get_remote_id()
|
||||||
|
|
Loading…
Reference in a new issue