in progress: a test for making sure changes in Account.status fires appropriate notices

pull/1/head
Raymond Yee 2013-03-04 07:50:21 -08:00
parent a7f6d8e7cc
commit 3e3a24b7db
1 changed files with 3 additions and 3 deletions

View File

@ -393,15 +393,15 @@ class AccountTest(TestCase):
self.user1.save()
self.user2 = User.objects.create_user('account_test2', 'account_test2@gluejar.com', 'account_test2_pw')
self.user2.save()
self.account1 = Account(host='host1', account_id='1', user=self.user1)
self.account1 = Account(host='host1', account_id='1', user=self.user1, status='ACTIVE')
self.account1.save()
self.account2 = Account(host='host1', account_id='2', user=self.user1)
self.account2 = Account(host='host1', account_id='2', user=self.user1, status='ACTIVE')
def test_constraint_at_most_one_active_account_per_user(self):
# https://www.pivotaltracker.com/story/show/37458303
# hould not be allowed to save account2, which has same host and user
# should not be allowed to save account2, which has same host and user
self.assertRaises(Exception, self.account2.save)
# only 1 account left in total