def test_get_or_create_if_account_sid_with_exception(self, twilio_account):
     twilio_account.return_value = self.mock_account()
     Account.get_or_create(account_sid='test')
     self.assertEqual(1, Account.objects.all().count())
     self.assertEqual('test', Account.objects.first().sid)
 def test_get_or_create_if_account_sid_no_exception(self):
     account_1 = mommy.make(Account, sid='test')
     account_2 = Account.get_or_create(account_sid='test')
     self.assertEqual(1, Account.objects.all().count())
     self.assertEqual(account_1, account_2)
 def test_get_or_create_if_not_account_sid_with_exception(self):
     Account.get_or_create(account=self.mock_account())
     self.assertEqual(1, Account.objects.all().count())
     self.assertEqual('test', Account.objects.first().sid)
 def test_get_status_choice_status_display_equal_choice(self):
     self.assertEqual(0, Account.get_status_choice('active'))
 def test_get_status_choice_status_display_not_equal_choice(self):
     self.assertEqual(None, Account.get_status_choice('test'))
 def test_get_account_type_choice_account_type_display_equal_choice(self):
     self.assertEqual(0, Account.get_account_type_choice('Trial'))
 def test_get_account_type_choice_account_type_display_not_equal_choice(
         self):
     self.assertEqual(None, Account.get_account_type_choice('test'))
Пример #8
0
 def test_get_or_create_if_not_account_sid_with_exception(self):
     Account.get_or_create(account=self.mock_account())
     self.assertEqual(1, Account.objects.all().count())
     self.assertEqual('test', Account.objects.first().sid)
Пример #9
0
 def test_get_or_create_if_account_sid_with_exception(self, twilio_account):
     twilio_account.return_value = self.mock_account()
     Account.get_or_create(account_sid='test')
     self.assertEqual(1, Account.objects.all().count())
     self.assertEqual('test', Account.objects.first().sid)
Пример #10
0
 def test_get_or_create_if_account_sid_no_exception(self):
     account_1 = mommy.make(Account, sid='test')
     account_2 = Account.get_or_create(account_sid='test')
     self.assertEqual(1, Account.objects.all().count())
     self.assertEqual(account_1, account_2)
Пример #11
0
 def test_get_status_choice_status_display_not_equal_choice(self):
     self.assertEqual(None, Account.get_status_choice('test'))
Пример #12
0
 def test_get_status_choice_status_display_equal_choice(self):
     self.assertEqual(0, Account.get_status_choice('active'))
Пример #13
0
 def test_get_account_type_choice_account_type_display_not_equal_choice(
         self):
     self.assertEqual(None, Account.get_account_type_choice('test'))
Пример #14
0
 def test_get_account_type_choice_account_type_display_equal_choice(self):
     self.assertEqual(0, Account.get_account_type_choice('Trial'))