forked from hiperderecho/proyectos_de_ley
-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
01a43aa
commit 8b31fb0
Showing
5 changed files
with
68 additions
and
15 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
42 changes: 42 additions & 0 deletions
42
proyectos_de_ley/pdl/tests/test_update_seguimientos_cmd.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
# -*- encoding: utf-8 -*- | ||
from datetime import date | ||
|
||
from django.test import TestCase | ||
|
||
from pdl.management.commands.update_seguimientos import Command | ||
from pdl.models import Proyecto | ||
from pdl.models import Seguimientos | ||
|
||
|
||
class USeguimientosTest(TestCase): | ||
def setUp(self): | ||
self.cmd = Command() | ||
self.maxDiff = None | ||
|
||
def test_handle(self): | ||
args = () | ||
options = { | ||
'settings': 'proyectos_de_ley.settings.local', | ||
'no_color': False, 'full_scrapping': False, 'verbosity': '1', | ||
'traceback': None, 'tor': False, 'debug': True, 'test': True, | ||
'pythonpath': None | ||
} | ||
|
||
# save an item to our test database | ||
item = { | ||
'codigo': '03774', | ||
'seguimiento_page': 'http://www2.congreso.gob.pe/Sicr/TraDocEst' | ||
'Proc/CLProLey2011.nsf/Sicr/TraDocEstProc/C' | ||
'LProLey2011.nsf/PAporNumeroInverso/9609130' | ||
'B9871582F05257D4A00752301?opendocument', | ||
'fecha_presentacion': date.today(), | ||
} | ||
b = Proyecto(**item) | ||
b.save() | ||
|
||
seguimientos = Seguimientos.objects.all() | ||
self.assertEqual(len(seguimientos), 0) | ||
|
||
self.cmd.handle(self, *args, **options) | ||
seguimientos = Seguimientos.objects.all() | ||
self.assertGreater(len(seguimientos), 1) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters