Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update some dependencies flagged by Requires.io #1676

Merged
merged 4 commits into from
Aug 22, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 11 additions & 4 deletions cadasta/accounts/tests/factories.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,18 @@ class Meta:
password = ''

@classmethod
def _prepare(cls, create, **kwargs):
def _build(cls, model_class, *args, **kwargs):
password = kwargs.pop('password', None)
user = super(UserFactory, cls)._prepare(create, **kwargs)
user = super()._build(model_class, *args, **kwargs)
if password:
user.set_password(password)
if create:
user.save()
return user

@classmethod
def _create(cls, model_class, *args, **kwargs):
password = kwargs.pop('password', None)
user = super()._create(model_class, *args, **kwargs)
if password:
user.set_password(password)
user.save()
return user
6 changes: 3 additions & 3 deletions cadasta/config/settings/dev.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,10 +56,10 @@

# Use HTTP for OSM for testing only, to make caching tiles for
# functional tests a bit simpler.
LEAFLET_CONFIG['TILES'][0] = (
LEAFLET_CONFIG['TILES'][0][0],
LEAFLET_CONFIG['TILES'][0] = ( # NOQA
LEAFLET_CONFIG['TILES'][0][0], # NOQA
'http://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png',
LEAFLET_CONFIG['TILES'][0][2]
LEAFLET_CONFIG['TILES'][0][2] # NOQA
)

CACHES = {
Expand Down
1 change: 1 addition & 0 deletions cadasta/config/settings/dev_debug.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
def always(*args):
return True


DEBUG_TOOLBAR_CONFIG = {
'SHOW_TOOLBAR_CALLBACK': always,
}
4 changes: 2 additions & 2 deletions cadasta/config/settings/production.py
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
import os
from .default import * # NOQA

INSTALLED_APPS += (
INSTALLED_APPS += ( # NOQA
'opbeat.contrib.django',
)

MIDDLEWARE_CLASSES = (
'opbeat.contrib.django.middleware.OpbeatAPMMiddleware',
'opbeat.contrib.django.middleware.Opbeat404CatchMiddleware',
) + MIDDLEWARE_CLASSES
) + MIDDLEWARE_CLASSES # NOQA

DEBUG = False

Expand Down
2 changes: 1 addition & 1 deletion cadasta/config/settings/test.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
from .dev import * # NOQA

MEDIA_ROOT = os.path.join(os.path.dirname(BASE_DIR), 'core/media/test')
MEDIA_ROOT = os.path.join(os.path.dirname(BASE_DIR), 'core/media/test') # NOQA
6 changes: 3 additions & 3 deletions cadasta/config/settings/travis.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,10 @@

# Use HTTP for OSM for testing only, to make caching tiles for
# functional tests a bit simpler.
LEAFLET_CONFIG['TILES'][0] = (
LEAFLET_CONFIG['TILES'][0][0],
LEAFLET_CONFIG['TILES'][0] = ( # NOQA
LEAFLET_CONFIG['TILES'][0][0], # NOQA
'http://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png',
LEAFLET_CONFIG['TILES'][0][2]
LEAFLET_CONFIG['TILES'][0][2] # NOQA
)

CACHES = {
Expand Down
1 change: 1 addition & 0 deletions cadasta/core/validators.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ def validate_json(value, schema):
if message_dict:
raise JsonValidationError(message_dict)


emojis = re.compile(
u'.*[\U0001F004\U0001F0CF\U0001F170-\U0001F171\U0001F17E\U0001F17F'
'\U0001F18E\U0001F191-\U0001F19A\U0001F1E6-\U0001F1FF'
Expand Down
4 changes: 2 additions & 2 deletions cadasta/organization/tests/test_fields.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ def test_clean(self):
value = ContactFormset({
'form-TOTAL_FORMS': '2',
'form-INITIAL_FORMS': '1',
'form-MAX_NUM_FORMS': '0',
'form-MIN_NUM_FORMS': '0',
'form-MAX_NUM_FORMS': '1000',
'form-0-name': 'Ringo',
'form-0-email': '[email protected]',
Expand All @@ -69,7 +69,7 @@ def test_invalid_clean(self):
value = ContactFormset({
'form-TOTAL_FORMS': '2',
'form-INITIAL_FORMS': '1',
'form-MAX_NUM_FORMS': '0',
'form-MIN_NUM_FORMS': '0',
'form-MAX_NUM_FORMS': '1000',
'form-0-name': 'Ringo',
'form-0-email': 'ringo@beatles',
Expand Down
2 changes: 1 addition & 1 deletion cadasta/organization/tests/test_widgets.py
Original file line number Diff line number Diff line change
Expand Up @@ -254,7 +254,7 @@ def test_value_from_datadict(self):
data = {
'contacts-TOTAL_FORMS': '2',
'contacts-INITIAL_FORMS': '1',
'contacts-MAX_NUM_FORMS': '0',
'contacts-MIN_NUM_FORMS': '0',
'contacts-MAX_NUM_FORMS': '1000',
'contacts-0-name': 'Ringo',
'contacts-0-email': '[email protected]',
Expand Down
1 change: 0 additions & 1 deletion cadasta/questionnaires/tests/test_managers.py
Original file line number Diff line number Diff line change
Expand Up @@ -348,7 +348,6 @@ class QuestionManagerTest(TestCase):

def test_create_from_dict(self):
question_dict = {
'hint': 'For this field (type=integer)',
'label': 'Integer',
'name': 'my_int',
'type': 'integer',
Expand Down
3 changes: 1 addition & 2 deletions cadasta/resources/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -187,8 +187,7 @@ def create_spatial_resource(sender, instance, created, **kwargs):
f.seek(0)
# need to double check the mime-type here as browser detection
# of gpx mime type is not reliable
mime = magic.Magic(mime=True)
mime_type = str(mime.from_file(f.name), 'utf-8')
mime_type = magic.from_file(f.name, mime=True)
if mime_type in GPX_MIME_TYPES:
processor = GPXProcessor(f.name)
layers = processor.get_layers()
Expand Down
12 changes: 4 additions & 8 deletions cadasta/resources/tests/factories.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,20 +25,16 @@ class Meta:
project = factory.SubFactory(ProjectFactory)

@classmethod
def _prepare(cls, create, **kwargs):
resource = super()._prepare(create, **kwargs)

if not resource.file.url:
def _after_postgeneration(cls, obj, create, results=None):
if not obj.file.url:
storage = FakeS3Storage()
file = open(path + '/resources/tests/files/image.jpg', 'rb')
file_name = storage.save('resources/image.jpg', file.read())
file.close()

resource.file = file_name
obj.file = file_name
if create:
resource.save()

return resource
obj.save()


class SpatialResourceFactory(ExtendedFactory):
Expand Down
50 changes: 25 additions & 25 deletions requirements/common.txt
Original file line number Diff line number Diff line change
@@ -1,40 +1,40 @@
Django==1.10.7
Django==1.10.7 # rq.filter: <1.11.0
djangorestframework==3.3.3
psycopg2==2.6.1
djoser==0.5.2
django-allauth==0.25.2
django-cors-headers==1.1.0
django-filter==1.0.1
django-crispy-forms==1.6.0
psycopg2==2.7.3
djoser==0.6.0
django-allauth==0.32.0
django-cors-headers==2.1.0
django-filter==1.0.4
django-crispy-forms==1.6.1
django-parsley==0.6
django-formtools==1.0
django-countries==3.4.1
django-formtools==2.0
django-countries==4.6.1
django-leaflet==0.18.1
django-sass-processor==0.3.4
djangorestframework-gis==0.10.1
jsonschema==2.5.1
rfc3987==1.3.5
django-sass-processor==0.5.4
djangorestframework-gis==0.11.2
jsonschema==2.6.0
rfc3987==1.3.7
drfdocs-cadasta==0.0.12
django-tutelary==0.1.21
django-audit-log==0.7.0
django-simple-history==1.8.1
simplejson==3.8.1
simplejson==3.11.1
django-widget-tweaks==1.4.1
django-buckets==0.1.22
pyxform-cadasta==0.9.22
python-magic==0.4.11
Pillow==3.4.2
python-magic==0.4.13
Pillow==4.2.1
django-jsonattrs==0.1.23
openpyxl==2.4.1
pytz==2016.4
shapely==1.5.16
gdal==1.10.0
openpyxl==2.4.8
pytz==2017.2
shapely==1.5.17.post1
gdal==1.10.0 # rq.filter: <2.0.0
pylibmc==1.5.2
awscli==1.11.23
pandas==0.19.0
awscli==1.11.129
pandas==0.20.3
argon2-cffi==16.3.0
requests==2.11.1
requests==2.18.3
pyparsing==2.2.0
django-compressor==2.0
beautifulsoup4==4.5.3
django-compressor==2.1.1
beautifulsoup4==4.6.0
gpxpy==1.1.2
22 changes: 11 additions & 11 deletions requirements/dev.txt
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
-r common.txt
pytest-django==2.9.1
factory_boy==2.8.1
pytest-cov==2.4.0
selenium==2.53.2
transifex-client==0.11
tox==2.3.1
flake8==2.5.4
django-debug-toolbar==1.5
django-extensions==1.7.8
django-skivvy==0.1.5
ipython==5.1.0
pytest-django==3.1.2
factory-boy==2.9.2
pytest-cov==2.5.1
selenium==3.4.3
transifex-client==0.12.4
tox==2.7.0
flake8==3.4.1
django-debug-toolbar==1.8
django-extensions==1.8.1
django-skivvy==0.1.8
ipython==6.1.0
2 changes: 1 addition & 1 deletion requirements/production.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
opbeat==3.5.1
opbeat==3.5.2
4 changes: 2 additions & 2 deletions tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -22,5 +22,5 @@ commands = python ./cadasta/manage.py makemigrations --check
[testenv:py35-flake8]
commands = ./runtests.py --lint
deps =
pytest==2.9.1
flake8==2.5.4
pytest==3.2.0
flake8==3.4.1