forked from expo/troggle
63 lines
2.5 KiB
Python
63 lines
2.5 KiB
Python
"""
|
|
This file demonstrates two different styles of tests (one doctest and one
|
|
unittest). These will both pass when you run "manage.py test".
|
|
|
|
Replace these with more appropriate tests for your application.
|
|
|
|
https://docs.python.org/3.8/library/doctest.html
|
|
|
|
https://docs.djangoproject.com/en/3.0/topics/testing/tools/
|
|
"""
|
|
|
|
from django.test import TestCase, SimpleTestCase
|
|
|
|
class SimpleTest(SimpleTestCase):
|
|
def test_basic_addition(self):
|
|
"""
|
|
Tests that 1 + 1 always equals 2.
|
|
"""
|
|
self.assertEqual(1 + 1, 2)
|
|
def test_import_TroggleModel(self):
|
|
from troggle.core.models import TroggleModel
|
|
def test_import_Cave(self):
|
|
from troggle.core.models_caves import Cave
|
|
def test_import_parsers_surveys(self):
|
|
from PIL import Image
|
|
from utils import save_carefully
|
|
from functools import reduce
|
|
def test_import_parsers_survex(self):
|
|
import troggle.settings as settings
|
|
import troggle.core.models as models
|
|
import troggle.core.models_caves as models_caves
|
|
import troggle.core.models_survex as models_survex
|
|
from troggle.parsers.people import GetPersonExpeditionNameLookup
|
|
from troggle.core.views_caves import MapLocations
|
|
def test_import_parsers_QMs(self):
|
|
from troggle.core.models_caves import QM, Cave, LogbookEntry
|
|
from utils import save_carefully
|
|
def test_import_parsers_people(self):
|
|
from html.parser import HTMLParser
|
|
from unidecode import unidecode
|
|
def test_import_parsers_logbooks(self):
|
|
from django.template.defaultfilters import slugify
|
|
from django.utils.timezone import get_current_timezone, make_aware
|
|
from troggle.core.models import DataIssue, Expedition
|
|
from troggle.core.models_caves import Cave, OtherCaveName, getCaveByReference, LogbookEntry, PersonTrip
|
|
from parsers.people import GetPersonExpeditionNameLookup
|
|
def test_import_core_views_caves(self):
|
|
from django.http import HttpResponse, HttpResponseRedirect
|
|
from django.shortcuts import get_object_or_404, render
|
|
from troggle.core.models import Expedition
|
|
from troggle.core.models_caves import CaveSlug, Cave, CaveAndEntrance, QM, CaveDescription, EntranceSlug, Entrance, Area, SurvexStation
|
|
from troggle.core.forms import CaveForm, CaveAndEntranceFormSet, VersionControlCommentForm, EntranceForm, EntranceLetterForm
|
|
from troggle.helper import login_required_if_public
|
|
|
|
|
|
__test__ = {"doctest": """
|
|
Another way to test that 1 + 1 is equal to 2.
|
|
|
|
>>> 1 + 1 == 2
|
|
True
|
|
"""}
|
|
|