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
class TestLNTemplates(TestTemplates): | |
""" | |
Runs webshop template tests for LN. | |
""" | |
def get_app(self): | |
""" | |
Gets the app object. | |
Sets LN template path. | |
""" |
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
if address_response.AddressValidationResult.Quality < 0.4: | |
cls.raise_user_error('The address entered was invalid.') | |
elif (address_response.AddressValidationResult.Quality >= 0.4) | |
and (address_response.AddressValidationResult.Quality < 0.6): | |
pass | |
else: | |
values = { | |
'city': address_response.AddressValidationResult.Address.City, | |
'zip': self.zip | |
} |
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
# Details | |
Zip: '33137' | |
City: 'Miami, Miami-Dade' | |
Country: 'US' | |
Subdivision: 'Florida' or 'US-FL'. | |
# XML Response | |
<?xml version="1.0" encoding="UTF-8"?> |
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
def _create_auth_net_gateway_for_site(self): | |
""" | |
A helper function that creates the authorize.net gateway and assigns | |
it to the websites. | |
""" | |
PaymentGateway = POOL.get('payment_gateway.gateway') | |
NereidWebsite = POOL.get('nereid.website') | |
Journal = POOL.get('account.journal') | |
cash_journal, = Journal.search([ |
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
#!/bin/env python | |
""" tryton_shell: A dirty shell for Tryton to quickly interact with it | |
usage: tryton_shell.py [-h] --config CONFIG --database DATABASE | |
arguments: | |
--config CONFIG Tryton config file. | |
--database DATABASE Tryton database. |
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
for argument in [ | |
{'name': 'None'}, | |
{'value': 'Value'}, | |
{'method_type': 'international'} | |
]: | |
self.assertRaises( | |
UserError, self.endicia_mailclass.write, | |
[endicia_mailclass], argument | |
) |
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
Code: | |
with Transaction().start(DB_NAME, USER, context=CONTEXT) as tr: | |
self.setup_defaults() | |
sale = self.create_sale(self.sale_party) | |
tr.set_context(sale=sale) | |
self.carrier.get_rates() | |
Partial Output: | |
(u'None Express Mail', Decimal('16.99'), self.currency1, {}, | |
{'endicia_mailclass': 1, 'carrier': 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
def test_get_rates(self): | |
""" | |
Test the get_rates method of Carrier. | |
""" | |
with Transaction().start(DB_NAME, USER, context=CONTEXT) as tr: | |
tr.set_context(sale=self.sale) | |
print(self.carrier.get_rates()) | |
Stack Trace: | |
ERROR: test_get_rates (tests.test_carrier.CarrierTestCase) |
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
endicia_mailclass, = self.endicia_mailclass.search([]) | |
self.endicia_mailclass.write([endicia_mailclass], { | |
'name': 'None' | |
}) |
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
Movie | |
<table border="1" style="font-size:90%; padding: 1px;border-spacing: | |
0px; border-collapse: separate"> | |
<tbody><tr border="1"><th style="border-width: | |
1px; padding: 3px; margin: 4px; border-style: inset; border-color: | |
gray;">mID</th><th style="border-width: 1px; padding: 3px; margin: 4px; | |
border-style: inset; border-color: gray;">title</th><th style="border-width: 1px; padding: 3px; margin: 4px; border-style: | |
inset; border-color: gray;">year</th><th style="border-width: 1px; | |
padding: 3px; margin: 4px; border-style: inset; border-color: | |
gray;">director</th></tr> |