Move some Agora functions to money/markets
This commit is contained in:
@@ -229,33 +229,3 @@ class TestAgora(TestCase):
|
||||
# Test specifying rates=
|
||||
lookup_rates_return = self.agora.money.lookup_rates(enum_ads_return, rates=cg_prices)
|
||||
self.assertCountEqual(lookup_rates_return, expected_return)
|
||||
|
||||
def test_format_ad(self):
|
||||
settings.settings.Platform.Ad = """* Set **Country of recipient's bank** to **"United Kingdom"**
|
||||
$PAYMENT$
|
||||
* Set **Company name** to **"PATHOGEN LIMITED"**"""
|
||||
payment_details = {"sort_code": "02-03-04", "account_number": "0023-0045"}
|
||||
payment_details_text = self.agora.format_payment_details("GBP", payment_details)
|
||||
ad_text = self.agora.format_ad("XMR", "GBP", payment_details_text)
|
||||
expected = """* Set **Country of recipient's bank** to **"United Kingdom"**
|
||||
* Company name: **PATHOGEN LIMITED**
|
||||
* Sort code: **02-03-04**
|
||||
* Account number: **0023-0045**
|
||||
* Please send in **GBP**
|
||||
* If you are asked for address information, please use **24 Holborn Viaduct, London, England, EC1A 2BN**
|
||||
* The post code is **EC1A 2BN**
|
||||
* Set **Company name** to **"PATHOGEN LIMITED"**"""
|
||||
print("EXPECT", ad_text)
|
||||
self.assertEqual(ad_text, expected)
|
||||
|
||||
def test_format_payment_details(self):
|
||||
payment_details = {"sort_code": "02-03-04", "account_number": "0023-0045"}
|
||||
payment_details_text = self.agora.format_payment_details("GBP", payment_details)
|
||||
|
||||
expected = """* Company name: **PATHOGEN LIMITED**
|
||||
* Sort code: **02-03-04**
|
||||
* Account number: **0023-0045**
|
||||
* Please send in **GBP**
|
||||
* If you are asked for address information, please use **24 Holborn Viaduct, London, England, EC1A 2BN**
|
||||
* The post code is **EC1A 2BN**"""
|
||||
self.assertEqual(payment_details_text, expected)
|
||||
|
||||
@@ -2,6 +2,7 @@ from unittest import TestCase
|
||||
from tests.common import fake_public_ads, expected_to_update
|
||||
from markets import Markets
|
||||
from sources.agora import Agora
|
||||
import settings
|
||||
|
||||
|
||||
class TestMarkets(TestCase):
|
||||
@@ -36,3 +37,33 @@ class TestMarkets(TestCase):
|
||||
|
||||
res_both = self.markets.get_new_ad_equations(fake_public_ads, ["XMR", "BTC"])
|
||||
self.assertCountEqual(res_both, expected_to_update)
|
||||
|
||||
def test_format_ad(self):
|
||||
settings.settings.Platform.Ad = """* Set **Country of recipient's bank** to **"United Kingdom"**
|
||||
$PAYMENT$
|
||||
* Set **Company name** to **"PATHOGEN LIMITED"**"""
|
||||
payment_details = {"sort_code": "02-03-04", "account_number": "0023-0045"}
|
||||
payment_details_text = self.markets.format_payment_details("GBP", payment_details)
|
||||
ad_text = self.markets.format_ad("XMR", "GBP", payment_details_text)
|
||||
expected = """* Set **Country of recipient's bank** to **"United Kingdom"**
|
||||
* Company name: **PATHOGEN LIMITED**
|
||||
* Sort code: **02-03-04**
|
||||
* Account number: **0023-0045**
|
||||
* Please send in **GBP**
|
||||
* If you are asked for address information, please use **24 Holborn Viaduct, London, England, EC1A 2BN**
|
||||
* The post code is **EC1A 2BN**
|
||||
* Set **Company name** to **"PATHOGEN LIMITED"**"""
|
||||
print("EXPECT", ad_text)
|
||||
self.assertEqual(ad_text, expected)
|
||||
|
||||
def test_format_payment_details(self):
|
||||
payment_details = {"sort_code": "02-03-04", "account_number": "0023-0045"}
|
||||
payment_details_text = self.markets.format_payment_details("GBP", payment_details)
|
||||
|
||||
expected = """* Company name: **PATHOGEN LIMITED**
|
||||
* Sort code: **02-03-04**
|
||||
* Account number: **0023-0045**
|
||||
* Please send in **GBP**
|
||||
* If you are asked for address information, please use **24 Holborn Viaduct, London, England, EC1A 2BN**
|
||||
* The post code is **EC1A 2BN**"""
|
||||
self.assertEqual(payment_details_text, expected)
|
||||
|
||||
Reference in New Issue
Block a user