Skip to content

Commit

Permalink
Add appconfig, fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
lucacorti committed Jun 28, 2016
1 parent 785edc4 commit c94a79f
Show file tree
Hide file tree
Showing 7 changed files with 16 additions and 5 deletions.
1 change: 1 addition & 0 deletions example/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
default_app_config = 'example.apps.ExampleConfig'
5 changes: 5 additions & 0 deletions example/apps.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
from django.apps import AppConfig

class ExampleConfig(AppConfig):
name = 'example'
verbose_name = "Example"
4 changes: 2 additions & 2 deletions geoposition/__init__.py
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
from __future__ import unicode_literals

from decimal import Decimal

default_app_config = 'geoposition.apps.GeoPositionConfig'

VERSION = (0, 2, 2)
__version__ = '.'.join(map(str, VERSION))


class Geoposition(object):
def __init__(self, latitude, longitude):
if isinstance(latitude, float) or isinstance(latitude, int):
Expand Down
5 changes: 5 additions & 0 deletions geoposition/apps.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
from django.apps import AppConfig

class GeoPositionConfig(AppConfig):
name = 'geoposition'
verbose_name = "GeoPosition"
1 change: 0 additions & 1 deletion geoposition/tests/__init__.py
Original file line number Diff line number Diff line change
@@ -1 +0,0 @@
from .test_geoposition import GeopositionTestCase
1 change: 1 addition & 0 deletions geoposition/tests/settings.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import os

BASE_DIR = os.path.dirname(os.path.dirname(__file__))

SECRET_KEY = '+*mac$-+vop%1#8zp%)blgacvst%fm)p$&u#p!5(x5nv9c0955'
Expand Down
4 changes: 2 additions & 2 deletions geoposition/tests/test_geoposition.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
from decimal import Decimal
from django.test import SimpleTestCase
from django.test import TestCase
from geoposition import Geoposition
from example.models import PointOfInterest


class GeopositionTestCase(SimpleTestCase):
class GeopositionTestCase(TestCase):
def test_init_with_decimals(self):
gp = Geoposition(Decimal('52.5'), Decimal('13.4'))
self.assertEqual(gp.latitude, Decimal('52.5'))
Expand Down

0 comments on commit c94a79f

Please sign in to comment.