feat(PaymentMethods): create endpoint.
This commit is contained in:
		
							
								
								
									
										23
									
								
								tienda_ilusion/don_confiao/tests/test_payment_methods.py
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										23
									
								
								tienda_ilusion/don_confiao/tests/test_payment_methods.py
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,23 @@ | ||||
| from django.test import Client, TestCase | ||||
|  | ||||
| # from ..models import PaymentMethods | ||||
|  | ||||
| class TestPaymentMethods(TestCase): | ||||
|     def setUp(self): | ||||
|         self.client = Client() | ||||
|  | ||||
|     def test_keys_in_payment_methods_to_select(self): | ||||
|         response = self.client.get( | ||||
|             '/don_confiao/payment_methods/all/select_format' | ||||
|         ) | ||||
|         methods = response.json() | ||||
|         for method in methods: | ||||
|             self.assertEqual(set(method.keys()), {'text', 'value'}) | ||||
|  | ||||
|     def test_basic_payment_methods_to_select(self): | ||||
|         methods = self.client.get( | ||||
|             '/don_confiao/payment_methods/all/select_format' | ||||
|         ).json() | ||||
|         self.assertIn('CASH', [method.get('value') for method in methods]) | ||||
|         self.assertIn('CONFIAR', [method.get('value') for method in methods]) | ||||
|         self.assertIn('BANCOLOMBIA', [method.get('value') for method in methods]) | ||||
		Reference in New Issue
	
	Block a user