Commit 3fc7a658 authored by Evili del Rio's avatar Evili del Rio

Cleanup tests. Add coverage, tox and sonarqube settings

parent 32ecb8cc
......@@ -3,4 +3,5 @@ omit =
# omit anything in a .env directory anywhere
*/.env*/*
/usr/*
*/env3*/*
*/site-packages/*
......@@ -97,3 +97,4 @@ db.sqlite3
# django static root on BASE_DIR
/static
/staticfiles
.scannerwork
......@@ -16,34 +16,3 @@ class BasicUrlsTest(unittest.TestCase):
def test_login(self):
resp = self.visit_view('login')
self.assertEqual(200, resp.status_code, "No login page")
# def test_logout(self):
# resp = self.visit_view('logout')
# self.assertEqual(200, resp.status_code, "No logout page")
# def test_password_change(self):
# resp = self.visit_view('password_change')
# self.assertEqual(200, resp.status_code, "No password change page")
# def test_password_change_done(self):
# resp = self.visit_view('password_change_done')
# self.assertEqual(200, resp.status_code, "No password change done page")
# def test_password_reset(self):
# resp = self.visit_view('password_reset')
# self.assertEqual(200, resp.status_code, "No password reset page")
# def test_password_reset_done(self):
# resp = self.visit_view('password_reset_done')
# self.assertEqual(200, resp.status_code, "No password reset-done page")
# def test_password_reset_confirm(self):
# resp = self.visit_view('password_reset_confirm', kwargs={
# 'uidb64':'9876543210',
# 'token': '0123456789-0123456789',
# })
# self.assertEqual(200, resp.status_code, "No reset-confirm page")
# def test_password_reset_complete(self):
# resp = self.visit_view('password_reset_complete')
# self.assertEqual(200, resp.status_code, "No reset-done page")
......@@ -83,12 +83,10 @@ class Species(BaseName):
genus = models.ForeignKey(Genus, on_delete=models.PROTECT)
def sci_name(self):
"""Scientific name of the especies. It's formed by the capitalized
Genus name followed by the proper name.
"""
return self.genus.name.capitalize()+u' '+self.name.lower()
return self.genus.name.capitalize()+' '+self.name.lower()
def __str__(self):
"""Return the Common Name of the Species in the current Locale. If
......@@ -138,8 +136,8 @@ class CommonName(models.Model):
species = models.ForeignKey(Species, on_delete=models.PROTECT)
locale = models.ForeignKey(Locale, on_delete=models.PROTECT)
def __unicode__(self):
return u'{0} ({1})'.format(self.cname, self.species.sci_name())
def __str__(self):
return '{0} ({1})'.format(self.cname, self.species.sci_name())
class Meta:
ordering = ['locale', 'species']
......
sonar.projectKey=evili:birding
#sonar.scm.provider=git
[tox]
skipsdist=True
envlist = flake8,pylint,coverage
[testenv:flake8]
deps = flake8
commands = flake8
[flake8]
exclude = .tox,migrations,env3
[testenv:pylint]
deps = pylint
-rrequirements.txt
commands = pylint --rcfile=tox.ini birding clades
[testenv:coverage]
deps = coverage
commands = coverage xml --rcfile=tox.ini --fail-under=50
[report]
show_missing = True
[testenv]
deps = coverage
-rrequirements-test.txt
-rrequirements.txt
commands = coverage run manage.py test
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment