coverage.xml
nosetests.xml
pip-log.txt
+/htmlcov
# Mac OS X garbage
.DS_Store
node_modules
/static_test
-chromedriver.log
\ No newline at end of file
+chromedriver.log
+++ /dev/null
-"""
-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.
-"""
-
-from django.test import TestCase
-
-class SimpleTest(TestCase):
- def test_basic_addition(self):
- """
- Tests that 1 + 1 always equals 2.
- """
- self.failUnlessEqual(1 + 1, 2)
-
-__test__ = {"doctest": """
-Another way to test that 1 + 1 is equal to 2.
-
->>> 1 + 1 == 2
-True
-"""}
-
def test_publish(self, api_call):
self.book[0].head.set_publishable(True)
self.book.publish(self.user)
- api_call.assert_called_with(self.user, 'books/', {"book_xml": self.text1})
+ api_call.assert_called_with(self.user, 'books/', {"book_xml": self.text1, "days": 0}, beta=False)
@patch('apiclient.api_call')
def test_publish_multiple(self, api_call):
self.book[1].commit(get_fixture('chunk2.xml'))
self.book[1].head.set_publishable(True)
self.book.publish(self.user)
- api_call.assert_called_with(self.user, 'books/', {"book_xml": get_fixture('expected.xml')})
+ api_call.assert_called_with(self.user, 'books/', {"book_xml": get_fixture('expected.xml'), "days": 0}, beta=False)
form = FlickrForm({"source_url": "https://www.flickr.com/photos/rczajka/6941928577/in/photostream"})
self.assertTrue(form.is_valid())
self.assertEqual(form.cleaned_data['source_url'], "https://www.flickr.com/photos/rczajka/6941928577/")
- self.assertEqual(form.cleaned_data['author'], "rczajka@Flickr")
+ self.assertEqual(form.cleaned_data['author'], "Radek Czajka@Flickr")
self.assertEqual(form.cleaned_data['title'], u"Pirate StaĆczyk")
self.assertEqual(form.cleaned_data['license_name'], "CC BY 2.0")
- self.assertEqual(form.cleaned_data['license_url'], "https://creativecommons.org/licenses/by/2.0/deed.en")
- self.assertEqual(form.cleaned_data['download_url'], "https://farm8.staticflickr.com/7069/6941928577_415844c58e_o.jpg")
+ self.assertEqual(form.cleaned_data['license_url'], "https://creativecommons.org/licenses/by/2.0/")
+ self.assertTrue('.staticflickr.com' in form.cleaned_data['download_url'])
-var $ = require('jquery');
+var jsdom = require("jsdom");
+var $ = require('jquery')(new jsdom.JSDOM().window);
var fs = require('fs');
var exec = require('child_process').exec;
var pd = require('pretty-data').pd;
+++ /dev/null
-from __future__ import with_statement
-
-import shutil
-import os
-import sys
-import logging
-
-logging.basicConfig(stream=sys.stderr, format="%(levelname)s:: %(message)s", level=logging.INFO)
-
-from string import Template
-
-class DeploySite(object):
-
- def __init__(self, **env):
- self.env = env
-
- for arg in ('ROOT', 'PROJECT_NAME', 'PYTHON_VERSION'):
- if arg not in self.env:
- raise ValueError("Argument '%s' is required." % arg)
-
- if 'PYTHON_BASE' not in self.env:
- self.env['PYTHON_BASE'] = os.path.join(self.env['ROOT'], 'pythonenv')
-
- if 'PYTHON_BIN' not in self.env:
- self.env['PYTHON_BIN'] = os.path.join(
- self.env['PYTHON_BASE'], 'bin', 'python') + self.env['PYTHON_VERSION']
-
- if 'PIP_BIN' not in self.env:
- self.env['PIP_BIN'] = os.path.join(self.env['PYTHON_BASE'], 'bin', 'pip')
-
- if 'PYTHON_SITE' not in self.env:
- self.env['PYTHON_SITE'] = os.path.join(
- self.env['PYTHON_BASE'], 'lib',
- 'python' + self.env['PYTHON_VERSION'], 'site-packages')
-
- if 'APP_DIR' not in self.env:
- self.env['APP_DIR'] = os.path.join(self.env['ROOT'], 'application')
-
- if 'CONFIG_DIR' not in self.env:
- self.env['CONFIG_DIR'] = os.path.join(self.env['ROOT'], 'etc')
-
- if 'MEDIA_DIR' not in self.env:
- self.env['MEDIA_DIR'] = os.path.join(self.env['ROOT'], 'www', 'media')
-
- self._logger = logging.getLogger("deployment")
-
- def info(self, *args, **kwargs):
- self._logger.info(*args, **kwargs)
-
- def render_template(self, source, dest, extra_context={}):
- self.info("Rendering template: %s", source)
-
- with open(source, 'rb') as source_file:
- t = Template(source_file.read())
-
- context = dict(self.env)
- context.update(extra_context)
-
- with open(dest, 'wb') as dest_file:
- dest_file.write(t.safe_substitute(context))
-
- self.info("Done.")
-
- def restart_app(self):
- pass
-
- def update_app(self):
- pass
-
- def update_config(self):
- pass
-
- def install_dependencies(self):
- pass
-
- def deploy(self):
- self.update_app()
- self.install_dependencies()
- self.update_config()
- self.restart_app()
-
- def find_resource(self, path):
- for dir in (self.env['CONFIG_DIR'], self.env['APP_DIR']):
- full_path = os.path.join(dir, path)
- if os.path.isfile(full_path):
- return full_path
-
- raise ValueError("Resource '%s' not found" % path)
-
- @classmethod
- def run_deploy(cls, *args, **kwargs):
- site = cls(*args, **kwargs)
- return site.deploy()
-
-class WSGISite(DeploySite):
-
- def __init__(self, **env):
- super(WSGISite, self).__init__(**env)
-
- if 'WSGI_FILE' not in self.env:
- self.env['WSGI_FILE'] = os.path.join(self.env['ROOT'], 'www',
- 'wsgi', self.env['PROJECT_NAME']) + '.wsgi'
-
- self.env['WSGI_DIR'] = os.path.dirname(self.env['WSGI_FILE'])
-
- if 'WSGI_SOURCE_FILE' not in self.env:
- self.env['WSGI_SOURCE_FILE'] = 'wsgi_app.template'
-
- if 'WSGI_USER' not in self.env:
- self.env['WSGI_USER'] = 'www-data'
-
- def restart_app(self):
- self.info("Restarting wsgi application: %s", self.env['WSGI_FILE'])
- os.system("touch %s" % self.env['WSGI_FILE'])
-
- def update_config(self):
- super(WSGISite, self).update_config()
-
- source = self.find_resource(self.env['WSGI_SOURCE_FILE'])
- self.render_template(source, self.env['WSGI_FILE'])
-
-class PIPSite(DeploySite):
-
- def install_dependencies(self):
- self.info("Installing requirements")
- os.system("%s install -r %s" % (self.env['PIP_BIN'], self.find_resource('requirements.txt')))
-
- try:
- self.info("Installing local requirements")
- os.system("%s install -r %s" % (self.env['PIP_BIN'], self.find_resource('requirements_local.txt')))
- except ValueError:
- pass
-
-class GitSite(DeploySite):
-
- def update_app(self):
- self.info("Updating repository.")
- os.system("cd %s; git pull" % self.env['APP_DIR'])
-
-class ApacheSite(DeploySite):
-
- def __init__(self, **env):
- super(ApacheSite, self).__init__(**env)
-
- if 'VHOST_SOURCE_FILE' not in self.env:
- self.env['VHOST_SOURCE_FILE'] = 'apache_vhost.template'
-
- if 'VHOST_FILE' not in self.env:
- self.env['VHOST_FILE'] = os.path.join(self.env['CONFIG_DIR'], self.env['PROJECT_NAME'] + '.vhost')
-
- def update_config(self):
- super(ApacheSite, self).update_config()
-
- source = self.find_resource(self.env['VHOST_SOURCE_FILE'])
- self.render_template(source, self.env['VHOST_FILE'])
+++ /dev/null
-{
- "dependencies": {
- "mocha": {
- "version": "1.8.2",
- "from": "mocha@",
- "dependencies": {
- "commander": {
- "version": "0.6.1",
- "from": "commander@0.6.1"
- },
- "growl": {
- "version": "1.7.0",
- "from": "growl@1.7.x"
- },
- "jade": {
- "version": "0.26.3",
- "from": "jade@0.26.3",
- "dependencies": {
- "mkdirp": {
- "version": "0.3.0",
- "from": "mkdirp@0.3.0"
- }
- }
- },
- "diff": {
- "version": "1.0.2",
- "from": "diff@1.0.2"
- },
- "debug": {
- "version": "0.7.2",
- "from": "debug@*"
- },
- "mkdirp": {
- "version": "0.3.3",
- "from": "mkdirp@0.3.3"
- },
- "ms": {
- "version": "0.3.0",
- "from": "ms@0.3.0"
- }
- }
- },
- "jsdom": {
- "version": "0.5.4",
- "from": "jsdom@",
- "dependencies": {
- "htmlparser": {
- "version": "1.7.6",
- "from": "htmlparser@1.x",
- "resolved": "https://registry.npmjs.org/htmlparser/-/htmlparser-1.7.6.tgz"
- },
- "nwmatcher": {
- "version": "1.3.1",
- "from": "nwmatcher@>=1.3.1",
- "resolved": "https://registry.npmjs.org/nwmatcher/-/nwmatcher-1.3.1.tgz"
- },
- "request": {
- "version": "2.16.6",
- "from": "request@2.x",
- "resolved": "https://registry.npmjs.org/request/-/request-2.16.6.tgz",
- "dependencies": {
- "form-data": {
- "version": "0.0.7",
- "from": "form-data@~0.0.3",
- "resolved": "https://registry.npmjs.org/form-data/-/form-data-0.0.7.tgz",
- "dependencies": {
- "combined-stream": {
- "version": "0.0.4",
- "from": "combined-stream@~0.0.4",
- "resolved": "https://registry.npmjs.org/combined-stream/-/combined-stream-0.0.4.tgz",
- "dependencies": {
- "delayed-stream": {
- "version": "0.0.5",
- "from": "delayed-stream@0.0.5",
- "resolved": "https://registry.npmjs.org/delayed-stream/-/delayed-stream-0.0.5.tgz"
- }
- }
- },
- "async": {
- "version": "0.1.22",
- "from": "async@~0.1.9"
- }
- }
- },
- "mime": {
- "version": "1.2.9",
- "from": "mime@~1.2.7"
- },
- "hawk": {
- "version": "0.10.2",
- "from": "hawk@~0.10.2",
- "resolved": "https://registry.npmjs.org/hawk/-/hawk-0.10.2.tgz",
- "dependencies": {
- "hoek": {
- "version": "0.7.1",
- "from": "hoek@0.7.x",
- "resolved": "https://registry.npmjs.org/hoek/-/hoek-0.7.1.tgz"
- },
- "boom": {
- "version": "0.3.7",
- "from": "boom@0.3.x",
- "resolved": "https://registry.npmjs.org/boom/-/boom-0.3.7.tgz"
- },
- "cryptiles": {
- "version": "0.1.3",
- "from": "cryptiles@0.1.x",
- "resolved": "https://registry.npmjs.org/cryptiles/-/cryptiles-0.1.3.tgz"
- },
- "sntp": {
- "version": "0.1.4",
- "from": "sntp@0.1.x",
- "resolved": "https://registry.npmjs.org/sntp/-/sntp-0.1.4.tgz"
- }
- }
- },
- "node-uuid": {
- "version": "1.4.0",
- "from": "node-uuid@~1.4.0"
- },
- "cookie-jar": {
- "version": "0.2.0",
- "from": "cookie-jar@~0.2.0",
- "resolved": "https://registry.npmjs.org/cookie-jar/-/cookie-jar-0.2.0.tgz"
- },
- "aws-sign": {
- "version": "0.2.0",
- "from": "aws-sign@~0.2.0",
- "resolved": "https://registry.npmjs.org/aws-sign/-/aws-sign-0.2.0.tgz"
- },
- "oauth-sign": {
- "version": "0.2.0",
- "from": "oauth-sign@~0.2.0",
- "resolved": "https://registry.npmjs.org/oauth-sign/-/oauth-sign-0.2.0.tgz"
- },
- "forever-agent": {
- "version": "0.2.0",
- "from": "forever-agent@~0.2.0",
- "resolved": "https://registry.npmjs.org/forever-agent/-/forever-agent-0.2.0.tgz"
- },
- "tunnel-agent": {
- "version": "0.2.0",
- "from": "tunnel-agent@~0.2.0",
- "resolved": "https://registry.npmjs.org/tunnel-agent/-/tunnel-agent-0.2.0.tgz"
- },
- "json-stringify-safe": {
- "version": "3.0.0",
- "from": "json-stringify-safe@~3.0.0",
- "resolved": "https://registry.npmjs.org/json-stringify-safe/-/json-stringify-safe-3.0.0.tgz"
- },
- "qs": {
- "version": "0.5.5",
- "from": "qs@~0.5.4",
- "resolved": "https://registry.npmjs.org/qs/-/qs-0.5.5.tgz"
- }
- }
- },
- "cssom": {
- "version": "0.2.5",
- "from": "cssom@0.2.x"
- },
- "cssstyle": {
- "version": "0.2.3",
- "from": "cssstyle@>=0.2.3"
- },
- "contextify": {
- "version": "0.1.5",
- "from": "contextify@~0.1.3",
- "resolved": "https://registry.npmjs.org/contextify/-/contextify-0.1.5.tgz",
- "dependencies": {
- "bindings": {
- "version": "1.1.0",
- "from": "bindings@*",
- "resolved": "https://registry.npmjs.org/bindings/-/bindings-1.1.0.tgz"
- }
- }
- }
- }
- },
- "jquery": {
- "version": "1.8.3",
- "from": "jquery@",
- "dependencies": {
- "jsdom": {
- "version": "0.5.4",
- "from": "jsdom@",
- "dependencies": {
- "htmlparser": {
- "version": "1.7.6",
- "from": "htmlparser@1.x",
- "resolved": "https://registry.npmjs.org/htmlparser/-/htmlparser-1.7.6.tgz"
- },
- "nwmatcher": {
- "version": "1.3.1",
- "from": "nwmatcher@>=1.3.1",
- "resolved": "https://registry.npmjs.org/nwmatcher/-/nwmatcher-1.3.1.tgz"
- },
- "request": {
- "version": "2.16.6",
- "from": "request@2.x",
- "resolved": "https://registry.npmjs.org/request/-/request-2.16.6.tgz",
- "dependencies": {
- "form-data": {
- "version": "0.0.7",
- "from": "form-data@~0.0.3",
- "resolved": "https://registry.npmjs.org/form-data/-/form-data-0.0.7.tgz",
- "dependencies": {
- "combined-stream": {
- "version": "0.0.4",
- "from": "combined-stream@~0.0.4",
- "resolved": "https://registry.npmjs.org/combined-stream/-/combined-stream-0.0.4.tgz",
- "dependencies": {
- "delayed-stream": {
- "version": "0.0.5",
- "from": "delayed-stream@0.0.5",
- "resolved": "https://registry.npmjs.org/delayed-stream/-/delayed-stream-0.0.5.tgz"
- }
- }
- },
- "async": {
- "version": "0.1.22",
- "from": "async@~0.1.9"
- }
- }
- },
- "mime": {
- "version": "1.2.9",
- "from": "mime@~1.2.7"
- },
- "hawk": {
- "version": "0.10.2",
- "from": "hawk@~0.10.2",
- "resolved": "https://registry.npmjs.org/hawk/-/hawk-0.10.2.tgz",
- "dependencies": {
- "hoek": {
- "version": "0.7.1",
- "from": "hoek@0.7.x",
- "resolved": "https://registry.npmjs.org/hoek/-/hoek-0.7.1.tgz"
- },
- "boom": {
- "version": "0.3.7",
- "from": "boom@0.3.x",
- "resolved": "https://registry.npmjs.org/boom/-/boom-0.3.7.tgz"
- },
- "cryptiles": {
- "version": "0.1.3",
- "from": "cryptiles@0.1.x",
- "resolved": "https://registry.npmjs.org/cryptiles/-/cryptiles-0.1.3.tgz"
- },
- "sntp": {
- "version": "0.1.4",
- "from": "sntp@0.1.x",
- "resolved": "https://registry.npmjs.org/sntp/-/sntp-0.1.4.tgz"
- }
- }
- },
- "node-uuid": {
- "version": "1.4.0",
- "from": "node-uuid@~1.4.0"
- },
- "cookie-jar": {
- "version": "0.2.0",
- "from": "cookie-jar@~0.2.0",
- "resolved": "https://registry.npmjs.org/cookie-jar/-/cookie-jar-0.2.0.tgz"
- },
- "aws-sign": {
- "version": "0.2.0",
- "from": "aws-sign@~0.2.0",
- "resolved": "https://registry.npmjs.org/aws-sign/-/aws-sign-0.2.0.tgz"
- },
- "oauth-sign": {
- "version": "0.2.0",
- "from": "oauth-sign@~0.2.0",
- "resolved": "https://registry.npmjs.org/oauth-sign/-/oauth-sign-0.2.0.tgz"
- },
- "forever-agent": {
- "version": "0.2.0",
- "from": "forever-agent@~0.2.0",
- "resolved": "https://registry.npmjs.org/forever-agent/-/forever-agent-0.2.0.tgz"
- },
- "tunnel-agent": {
- "version": "0.2.0",
- "from": "tunnel-agent@~0.2.0",
- "resolved": "https://registry.npmjs.org/tunnel-agent/-/tunnel-agent-0.2.0.tgz"
- },
- "json-stringify-safe": {
- "version": "3.0.0",
- "from": "json-stringify-safe@~3.0.0",
- "resolved": "https://registry.npmjs.org/json-stringify-safe/-/json-stringify-safe-3.0.0.tgz"
- },
- "qs": {
- "version": "0.5.5",
- "from": "qs@~0.5.4",
- "resolved": "https://registry.npmjs.org/qs/-/qs-0.5.5.tgz"
- }
- }
- },
- "cssom": {
- "version": "0.2.5",
- "from": "cssom@0.2.x"
- },
- "cssstyle": {
- "version": "0.2.3",
- "from": "cssstyle@>=0.2.3"
- },
- "contextify": {
- "version": "0.1.5",
- "from": "contextify@~0.1.3",
- "resolved": "https://registry.npmjs.org/contextify/-/contextify-0.1.5.tgz",
- "dependencies": {
- "bindings": {
- "version": "1.1.0",
- "from": "bindings@*",
- "resolved": "https://registry.npmjs.org/bindings/-/bindings-1.1.0.tgz"
- }
- }
- }
- }
- },
- "htmlparser": {
- "version": "1.7.6",
- "from": "htmlparser@1.x",
- "resolved": "https://registry.npmjs.org/htmlparser/-/htmlparser-1.7.6.tgz"
- },
- "xmlhttprequest": {
- "version": "1.4.2",
- "from": "xmlhttprequest@~1.4.2"
- },
- "location": {
- "version": "0.0.1",
- "from": "location@0.0.1",
- "resolved": "https://registry.npmjs.org/location/-/location-0.0.1.tgz"
- },
- "navigator": {
- "version": "1.0.1",
- "from": "navigator@~1.0.1",
- "resolved": "https://registry.npmjs.org/navigator/-/navigator-1.0.1.tgz"
- },
- "contextify": {
- "version": "0.1.5",
- "from": "contextify@~0.1.3",
- "resolved": "https://registry.npmjs.org/contextify/-/contextify-0.1.5.tgz",
- "dependencies": {
- "bindings": {
- "version": "1.1.0",
- "from": "bindings@*",
- "resolved": "https://registry.npmjs.org/bindings/-/bindings-1.1.0.tgz"
- }
- }
- }
- }
- },
- "pretty-data": {
- "version": "0.40.0",
- "from": "pretty-data@"
- },
- "ansidiff": {
- "version": "1.0.0",
- "from": "ansidiff@",
- "resolved": "https://registry.npmjs.org/ansidiff/-/ansidiff-1.0.0.tgz",
- "dependencies": {
- "diff": {
- "version": "1.0.4",
- "from": "diff@1.0",
- "resolved": "https://registry.npmjs.org/diff/-/diff-1.0.4.tgz"
- }
- }
- }
- }
-}
{
-"engines": {
- "node": "0.8.x",
- "npm": ">=1.1.2"
+ "dependencies": {
+ "ansidiff": "^1.0.0",
+ "jquery": "^3.3.1",
+ "jsdom": "^13.2.0",
+ "mocha": "^6.0.2",
+ "pretty-data": "^0.40.0"
+ }
}
-}
\ No newline at end of file
)
SECRET_KEY = "not-so-secret"
+
+
+LITERARY_DIRECTOR_USERNAME = 'Kaowiec'