More housekeeping: remove nose and unused cruft.
authorRadek Czajka <rczajka@rczajka.pl>
Wed, 6 Mar 2019 22:10:40 +0000 (23:10 +0100)
committerRadek Czajka <rczajka@rczajka.pl>
Wed, 6 Mar 2019 22:10:40 +0000 (23:10 +0100)
17 files changed:
.gitignore
Makefile [new file with mode: 0644]
hudson_build.sh [deleted file]
logging.cfg [deleted file]
logging.cfg.dev [deleted file]
requirements-test.txt [deleted file]
requirements.txt [deleted file]
requirements/requirements-dev.txt [new file with mode: 0644]
requirements/requirements-test.txt [new file with mode: 0644]
requirements/requirements.txt [new file with mode: 0644]
src/catalogue/tests/test_gallery.py
src/cover/tests.py
src/dvcs/tests/tests.py
src/redakcja/settings/__init__.py
src/redakcja/settings/defaults.py
src/redakcja/settings/test.py
src/wiki_img/tests.py

index 26e48d3..ee2673e 100644 (file)
@@ -13,7 +13,6 @@ var
 .coverage
 .coveragerc
 coverage.xml
-nosetests.xml
 pip-log.txt
 /htmlcov
 
diff --git a/Makefile b/Makefile
new file mode 100644 (file)
index 0000000..304f5db
--- /dev/null
+++ b/Makefile
@@ -0,0 +1,18 @@
+.PHONY: deploy test
+
+
+deploy: src/redakcja/localsettings.py
+       pip install -r requirements/requirements.txt
+       src/manage.py migrate --noinput
+       src/manage.py collectstatic --noinput
+
+
+.ONESHELL:
+test:
+       cd src
+       coverage run --branch --source='.' ./manage.py test --settings=redakcja.settings.test; true
+       coverage html -d ../htmlcov.new
+       rm -rf ../htmlcov
+       mv ../htmlcov.new ../htmlcov
+       coverage report
+       rm .coverage
diff --git a/hudson_build.sh b/hudson_build.sh
deleted file mode 100644 (file)
index c2b85df..0000000
+++ /dev/null
@@ -1,6 +0,0 @@
-cd $WORKSPACE
-virtualenv -q ve
-source ./ve/bin/activate
-pip install -q -E ./ve -r requirements.txt
-pip install -q -E ./ve -r requirements-test.txt
-django-admin.py test --settings=redakcja.settings.test
diff --git a/logging.cfg b/logging.cfg
deleted file mode 100644 (file)
index 9bfa56c..0000000
+++ /dev/null
@@ -1,29 +0,0 @@
-[loggers]
-keys=root,fnp
-
-[handlers]
-keys=console
-
-[formatters]
-keys=default
-
-[logger_root]
-level=DEBUG
-handlers=console
-
-[logger_fnp]
-level=DEBUG
-handlers=console
-qualname=fnp
-propagate=0
-
-[formatter_default]
-format=%(asctime)s %(name)s/%(levelname)s :: %(module)s.%(funcName)s:%(lineno)d :: %(message)s
-datefmt=
-class=logging.Formatter
-
-[handler_console]
-class=StreamHandler
-level=DEBUG
-formatter=default
-args=(sys.stderr, ) 
\ No newline at end of file
diff --git a/logging.cfg.dev b/logging.cfg.dev
deleted file mode 100644 (file)
index 23a7833..0000000
+++ /dev/null
@@ -1,29 +0,0 @@
-[loggers]
-keys=root,fnp
-
-[handlers]
-keys=console
-
-[formatters]
-keys=default
-
-[logger_root]
-level=DEBUG
-handlers=console
-
-[logger_fnp]
-level=DEBUG
-handlers=console
-qualname=fnp
-propagate=0
-
-[formatter_default]
-format=%(asctime)s %(name)s/%(levelname)s :: %(module)s.%(funcName)s:%(lineno)d :: %(message)s
-datefmt=
-class=logging.Formatter
-
-[handler_console]
-class=FileHandler
-level=DEBUG
-formatter=default
-args=('redakcja.dev.log', ) 
diff --git a/requirements-test.txt b/requirements-test.txt
deleted file mode 100644 (file)
index 70ee4a0..0000000
+++ /dev/null
@@ -1,5 +0,0 @@
-django-nose==1.2
-nose
-nosexcover
-mock
-selenium
diff --git a/requirements.txt b/requirements.txt
deleted file mode 100644 (file)
index 2781a33..0000000
+++ /dev/null
@@ -1,27 +0,0 @@
--i https://py.mdrn.pl/simple
-
-## Python libraries
-Mercurial>=3.3,<3.4
-PyYAML>=3.0
-Pillow
-oauth2
-httplib2 # oauth2 dependency
-
-librarian
-
-## Django
-Django==1.11.20
-fnpdjango==0.3
-django-pipeline==1.6.14
-django_cas>=2.1,<2.2
-sorl-thumbnail>=12.2,<12.4  # ??
-django-maintenancemode>=0.9
-fnp-django-pagination==2.2.2
-django-gravatar2
-python-slugify
-django-extensions==1.5.7
-
-celery>=3.1.12,<3.2
-kombu>=3.0,<3.1
-
-raven
diff --git a/requirements/requirements-dev.txt b/requirements/requirements-dev.txt
new file mode 100644 (file)
index 0000000..aec394f
--- /dev/null
@@ -0,0 +1 @@
+django-debug-toolbar
diff --git a/requirements/requirements-test.txt b/requirements/requirements-test.txt
new file mode 100644 (file)
index 0000000..49f7cff
--- /dev/null
@@ -0,0 +1,3 @@
+coverage
+mock
+selenium
diff --git a/requirements/requirements.txt b/requirements/requirements.txt
new file mode 100644 (file)
index 0000000..2781a33
--- /dev/null
@@ -0,0 +1,27 @@
+-i https://py.mdrn.pl/simple
+
+## Python libraries
+Mercurial>=3.3,<3.4
+PyYAML>=3.0
+Pillow
+oauth2
+httplib2 # oauth2 dependency
+
+librarian
+
+## Django
+Django==1.11.20
+fnpdjango==0.3
+django-pipeline==1.6.14
+django_cas>=2.1,<2.2
+sorl-thumbnail>=12.2,<12.4  # ??
+django-maintenancemode>=0.9
+fnp-django-pagination==2.2.2
+django-gravatar2
+python-slugify
+django-extensions==1.5.7
+
+celery>=3.1.12,<3.2
+kombu>=3.0,<3.1
+
+raven
index 4b8ea3f..5c239ad 100644 (file)
@@ -114,7 +114,6 @@ class GalleryAppendTests(TestCase):
 
 
     def test_none_indexed(self):
-        import nose.tools
         self.book2 = Book.create(self.user, 'book 2', slug='book2')
         self.make_gallery(self.book1, {
             '1-0001_1l' : 'aa',
index be8d003..a4f5a5e 100644 (file)
@@ -3,7 +3,6 @@
 # This file is part of FNP-Redakcja, licensed under GNU Affero GPLv3 or later.
 # Copyright © Fundacja Nowoczesna Polska. See NOTICE for more information.
 #
-from nose.tools import *
 from django.test import TestCase
 from cover.forms import FlickrForm
 
index 06160ca..d4e9b0b 100644 (file)
@@ -1,4 +1,3 @@
-from nose.tools import *
 from django.test import TestCase
 from .models import ADocument
 
@@ -10,7 +9,6 @@ class DocumentModelTests(TestCase):
         )
 
     def test_empty_file(self):
-        assert False
         doc = ADocument.objects.create()
         self.assertTextEqual(doc.materialize(), u"")
 
index b9bdf5d..cc88ab8 100644 (file)
@@ -1,9 +1,9 @@
 # -*- coding: utf-8 -*-
 from __future__ import absolute_import
 import os.path
-from redakcja.settings.defaults import *
-from redakcja.localsettings import *
-
+from .defaults import *
+from ..localsettings import *
+import os
 
 PROJECT_ROOT = os.path.realpath(os.path.dirname(os.path.dirname(__file__)))
 
index 688e2b6..63f9e93 100644 (file)
@@ -23,6 +23,8 @@ ADMINS = (
     (u'Radek Czajka', 'radoslaw.czajka@nowoczesnapolska.org.pl'),
 )
 
+INTERNAL_IPS = ['127.0.0.1']
+
 MANAGERS = ADMINS
 
 # Local time zone for this installation. Choices can be found here:
index c026af0..55cc3e6 100644 (file)
@@ -1,7 +1,3 @@
-#
-# Nose tests
-#
-
 from redakcja.settings import *
 
 DATABASES = {
index 6577737..2b342da 100644 (file)
@@ -1,4 +1,3 @@
-from nose.tools import *
 import wiki.models as models
 import shutil
 import tempfile
@@ -6,7 +5,7 @@ import tempfile
 
 class TestStorageBase:
     def setUp(self):
-        self.dirpath = tempfile.mkdtemp(prefix='nosetest_')
+        self.dirpath = tempfile.mkdtemp(prefix='redakcja_test_')
 
     def tearDown(self):
         shutil.rmtree(self.dirpath)
@@ -16,4 +15,4 @@ class TestDocumentStorage(TestStorageBase):
 
     def test_storage_empty(self):
         storage = models.DocumentStorage(self.dirpath)
-        eq_(storage.all(), [])
+        self.assertEqual(storage.all(), [])