Skip to content

Commit

Permalink
[connection] Fixed admin tests
Browse files Browse the repository at this point in the history
Added missing inline form parameters
  • Loading branch information
nemesifier committed May 9, 2018
1 parent 5af2a2a commit 3c5568c
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 3 deletions.
2 changes: 2 additions & 0 deletions .travis.yml
Expand Up @@ -38,6 +38,8 @@ install:
- pip install $DJANGO
# temporary, TODO: release django-netjsonconfig 0.8.1 and remove this
- pip install https://github.com/openwisp/django-netjsonconfig/tarball/master
# temporary, TODO: release django-loci 0.2.1 and remove this
- pip install https://github.com/openwisp/django-loci/tarball/master
- python setup.py -q develop
- if [[ $TRAVIS_PYTHON_VERSION == "2.7" ]]; then pip install git+git://github.com/tinio/pysqlite.git@extension-enabled#egg=pysqlite; fi

Expand Down
9 changes: 9 additions & 0 deletions openwisp_controller/config/tests/test_admin.py
Expand Up @@ -41,6 +41,15 @@ class TestAdmin(CreateConfigTemplateMixin, TestAdminMixin,
'config-INITIAL_FORMS': 0,
'config-MIN_NUM_FORMS': 0,
'config-MAX_NUM_FORMS': 1,
# openwisp_controller.connection
'deviceconnection_set-TOTAL_FORMS': 0,
'deviceconnection_set-INITIAL_FORMS': 0,
'deviceconnection_set-MIN_NUM_FORMS': 0,
'deviceconnection_set-MAX_NUM_FORMS': 1000,
'deviceip_set-TOTAL_FORMS': 0,
'deviceip_set-INITIAL_FORMS': 0,
'deviceip_set-MIN_NUM_FORMS': 0,
'deviceip_set-MAX_NUM_FORMS': 1000,
}
# WARNING - WATCHOUT
# this class attribute is changed dinamically
Expand Down
5 changes: 3 additions & 2 deletions openwisp_controller/connection/connectors/ssh.py
@@ -1,14 +1,15 @@
import logging
import sys

import paramiko
from django.utils.functional import cached_property
from jsonschema import validate
from jsonschema.exceptions import ValidationError as SchemaError
from scp import SCPClient

try:
if sys.version_info.major > 2: # pragma: nocover
from io import StringIO
except ImportError:
else: # pragma: nocover
from StringIO import StringIO


Expand Down
1 change: 0 additions & 1 deletion openwisp_controller/connection/models.py
Expand Up @@ -72,7 +72,6 @@ def __str__(self):
return '{0} ({1})'.format(self.name, self.get_connector_display())


@python_2_unicode_compatible
class DeviceConnection(ConnectorMixin, TimeStampedEditableModel):
_connector_field = 'update_strategy'
device = models.ForeignKey('config.Device', on_delete=models.CASCADE)
Expand Down
1 change: 1 addition & 0 deletions requirements-test.txt
Expand Up @@ -2,3 +2,4 @@ coverage
coveralls
isort
flake8
mock-ssh-server>=0.5.0,<0.6.0

0 comments on commit 3c5568c

Please sign in to comment.