def test_disable_deletes_account(self): # test enabled being false when we have an account. In this case # save() should delete the account account = BrightcoveCMSAccountFactory(team=self.team) assert_equal(models.BrightcoveCMSAccount.objects.count(), 1) form = forms.BrightcoveCMSAccountForm(self.team, {}) assert_true(form.is_valid(), form.errors.as_text()) form.save() assert_equal(models.BrightcoveCMSAccount.objects.count(), 0)
def test_no_feed(self): form = forms.BrightcoveCMSAccountForm( self.team, { 'enabled': '1', 'publisher_id': self.publisher_id, 'client_id': self.client_id, 'client_secret': self.client_secret, }) assert_true(form.is_valid(), form.errors.as_text()) account = form.save() self.assertEquals(account.publisher_id, self.publisher_id) self.assertEquals(account.client_id, self.client_id) self.assertEquals(account.team, self.team) self.assertEquals(account.client_secret, self.client_secret)
def test_disable_no_account(self): # test enabled being false when there's no account to delete. In this # case save() should be a no-op form = forms.BrightcoveCMSAccountForm(self.team, {}) assert_true(form.is_valid(), form.errors.as_text()) form.save()