mirror of
https://github.com/bookwyrm-social/bookwyrm.git
synced 2024-11-22 01:21:07 +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-journal
|
||||
|
||||
# Fedireads
|
||||
# BookWyrm
|
||||
.env
|
||||
/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
|
||||
# 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': {
|
||||
'ENGINE': 'django.db.backends.postgresql_psycopg2',
|
||||
'NAME': env('POSTGRES_DB', 'fedireads'),
|
||||
|
@ -95,7 +95,7 @@ FEDIREADS_DBS = {
|
|||
}
|
||||
|
||||
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
|
||||
|
||||
|
||||
class FedireadsConnector(TestCase):
|
||||
class BookWyrmConnector(TestCase):
|
||||
def setUp(self):
|
||||
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
|
||||
|
||||
|
||||
class FedireadsConnector(TestCase):
|
||||
class BookWyrmConnector(TestCase):
|
||||
def setUp(self):
|
||||
models.Connector.objects.create(
|
||||
identifier='example.com',
|
||||
|
|
|
@ -2,13 +2,13 @@
|
|||
from django.test import TestCase
|
||||
|
||||
from bookwyrm import models
|
||||
from bookwyrm.models.base_model import FedireadsModel
|
||||
from bookwyrm.models.base_model import BookWyrmModel
|
||||
from bookwyrm.settings import DOMAIN
|
||||
|
||||
|
||||
class BaseModel(TestCase):
|
||||
def test_remote_id(self):
|
||||
instance = FedireadsModel()
|
||||
instance = BookWyrmModel()
|
||||
instance.id = 1
|
||||
expected = instance.get_remote_id()
|
||||
self.assertEqual(expected, 'https://%s/bookwyrmmodel/1' % DOMAIN)
|
||||
|
@ -16,7 +16,7 @@ class BaseModel(TestCase):
|
|||
def test_remote_id_with_user(self):
|
||||
user = models.User.objects.create_user(
|
||||
'mouse', 'mouse@mouse.com', 'mouseword')
|
||||
instance = FedireadsModel()
|
||||
instance = BookWyrmModel()
|
||||
instance.user = user
|
||||
instance.id = 1
|
||||
expected = instance.get_remote_id()
|
||||
|
|
Loading…
Reference in a new issue