diff --git a/PyRIGS/settings.py b/PyRIGS/settings.py index 8c6d78b6..f3976222 100644 --- a/PyRIGS/settings.py +++ b/PyRIGS/settings.py @@ -73,13 +73,13 @@ DATABASES = { 'ENGINE': 'django.db.backends.sqlite3', 'NAME': os.path.join(BASE_DIR, 'db.sqlite3'), }, - 'legacy': { - 'ENGINE': 'django.db.backends.mysql', - 'HOST': 'alfie.codedinternet.com', - 'NAME': 'tec_rigs', - 'USER': 'tec_rigs', - 'PASSWORD': 'xMNb(b+Giu]&', - } + # 'legacy': { + # 'ENGINE': 'django.db.backends.mysql', + # 'HOST': 'alfie.codedinternet.com', + # 'NAME': 'tec_rigs', + # 'USER': 'tec_rigs', + # 'PASSWORD': 'xMNb(b+Giu]&', + # } } # User system diff --git a/RIGS/test_models.py b/RIGS/test_models.py new file mode 100644 index 00000000..dfc0824f --- /dev/null +++ b/RIGS/test_models.py @@ -0,0 +1,17 @@ +from django.test import TestCase +from RIGS import models + +class VatRateTestCase(TestCase): + def setUp(self): + models.VatRate.objects.create(start_at='2014-03-01',rate=0.20,comment='test1') + models.VatRate.objects.create(start_at='2016-03-01',rate=0.15,comment='test2') + + def test_find_correct(self): + r = models.VatRate.objects.find_rate('2015-03-01') + self.assertEqual(r.comment, 'test1') + r = models.VatRate.objects.find_rate('2016-03-01') + self.assertEqual(r.comment, 'test2') + + def test_percent_correct(self): + r = models.VatRate.objects.get(rate=0.20) + self.assertEqual(r.as_percent, 20) \ No newline at end of file diff --git a/RIGS/tests.py b/RIGS/tests.py deleted file mode 100644 index 7ce503c2..00000000 --- a/RIGS/tests.py +++ /dev/null @@ -1,3 +0,0 @@ -from django.test import TestCase - -# Create your tests here.