Skip to content

Commit

Permalink
Update document type description
Browse files Browse the repository at this point in the history
Fix typo - eletronic -> electronic

Fix typo

Remove extra blank line
  • Loading branch information
giovanisleite committed Oct 16, 2019
1 parent cdceafc commit cd752ff
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 6 deletions.
5 changes: 2 additions & 3 deletions jarbas/chamber_of_deputies/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,11 +31,11 @@ def __init__(self, year, applicant_id, document_id, document_type):
@property
def url(self):
if self.document_type == self.ELETRONIC_RECEIPT_TYPE:
return self.eletronic_url()
return self.electronic_url()

return self.pdf_url()

def eletronic_url(self):
def electronic_url(self):
return (
'https://www.camara.leg.br/cota-parlamentar/'
'nota-fiscal-eletronica?ideDocumentoFiscal={}'
Expand All @@ -49,7 +49,6 @@ def pdf_url(self):
'cota-parlamentar/documentos/publ/{}/{}/{}.pdf'
).format(*args)


@property
def exists(self):
status = head(self.url).status_code
Expand Down
6 changes: 3 additions & 3 deletions jarbas/chamber_of_deputies/tests/test_receipt_class.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,16 +10,16 @@ class TestReceipt(TestCase):

def setUp(self):
self.receipt = Receipt(1970, 13, 42, 1)
self.eletronic_receipt = Receipt(1970, 13, 42, 4)
self.electronic_receipt = Receipt(1970, 13, 42, 4)

def test_url(self):
expected = 'http://www.camara.gov.br/cota-parlamentar/documentos/publ/13/1970/42.pdf'
self.assertEqual(expected, self.receipt.url)

def test_eletronic_url(self):
def test_electronic_url(self):
expected = ('https://www.camara.leg.br/cota-parlamentar/nota-fiscal-eletronica?'
'ideDocumentoFiscal=42')
self.assertEqual(expected, self.eletronic_receipt.url)
self.assertEqual(expected, self.electronic_receipt.url)

@patch('jarbas.chamber_of_deputies.models.head')
def test_existing_url(self, mocked_head):
Expand Down
3 changes: 3 additions & 0 deletions jarbas/layers/elm/Internationalization.elm
Original file line number Diff line number Diff line change
Expand Up @@ -348,6 +348,9 @@ translate lang trans =
2 ->
DocumentType.expenseMadeAbroad

4 ->
DocumentType.electronicReceipt

_ ->
Common.empty
in
Expand Down
6 changes: 6 additions & 0 deletions jarbas/layers/elm/Internationalization/DocumentType.elm
Original file line number Diff line number Diff line change
Expand Up @@ -22,3 +22,9 @@ expenseMadeAbroad =
TranslationSet
"Expense made abroad"
"Despesa no exterior"

electronicReceipt : TranslationSet
electronicReceipt =
TranslationSet
"Electronic receipt"
"Nota fiscal eletrônica"

0 comments on commit cd752ff

Please sign in to comment.