Advertisement
Guest User

Untitled

a guest
May 24th, 2017
62
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.58 KB | None | 0 0
  1. from django.db import connection
  2. from django.test import TestCase
  3.  
  4. from ..behaviors import WalletIntegration
  5.  
  6.  
  7. class TestModel(WalletIntegration):
  8. class Meta:
  9. app_label = 'test'
  10.  
  11.  
  12. class WalletTestCase(TestCase):
  13. def setUp(self):
  14. with connection.schema_editor() as schema_editor:
  15. schema_editor.create_model(TestModel)
  16.  
  17. def test_wallet_id(self):
  18. model = TestModel.objects.create()
  19. self.assertIsNone(model.wallet_id)
  20.  
  21. def test_wallet_property(self):
  22. model = TestModel.objects.create()
  23. self.assertTrue(hasattr(model, 'wallet'))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement