Permalink
Browse files

check that there was an error msg in the result for locked tests

  • Loading branch information...
1 parent d48e4f7 commit 2a6c948a7c819db680ce2d33aeb78c4166839004 @sergiocharpineljr sergiocharpineljr committed Aug 17, 2012
Showing with 10 additions and 0 deletions.
  1. +4 −0 ispdb/tests/test_approve.py
  2. +2 −0 ispdb/tests/test_delete.py
  3. +2 −0 ispdb/tests/test_edit.py
  4. +2 −0 ispdb/tests/test_issue.py
View
4 ispdb/tests/test_approve.py
@@ -23,6 +23,8 @@ def test_unauthenticated_user(self):
self.assertRedirects(result, goodRedirect)
def test_locked_config(self):
+ user_info = {"username": "test_admin", "password": "test"}
+ self.client.login(**user_info)
config = Config.objects.get(id=1)
config.locked = True
config.save()
@@ -32,6 +34,8 @@ def test_locked_config(self):
config = Config.objects.get(id=1)
# Should not have changed the config
assert_equal(config.status, 'requested')
+ assert_true("This configuration is locked. Only admins can unlock it."
+ in result.content)
def test_authenticated_user(self):
user_info = {"username": "test_admin", "password": "test"}
View
2 ispdb/tests/test_delete.py
@@ -54,6 +54,8 @@ def test_delete_locked_config(self):
self.client.logout()
config = models.Config.objects.get(pk=1)
assert_true(config.status != 'deleted')
+ assert_true("This configuration is locked. Only admins can unlock it."
+ in res.content)
def test_delete_domainrequest(self):
self.delete_domain(1)
View
2 ispdb/tests/test_edit.py
@@ -55,6 +55,8 @@ def test_edit_locked_config(self):
follow=True)
config = models.Config.objects.get(pk=1)
assert_true(config.display_name != "testing2")
+ assert_true("This configuration is locked. Only admins can unlock it."
+ in res.content)
def test_edit_same_user(self):
self.add_domain()
View
2 ispdb/tests/test_issue.py
@@ -108,6 +108,8 @@ def test_merge_locked_config(self):
issue = models.Issue.objects.get(title='Test')
assert_equal(issue.status, "open")
assert_true(issue.config.display_name != "testing2")
+ assert_true("This configuration is locked. Only admins can unlock it."
+ in res.content)
def test_merge_issue_superuser(self):
self.add_issue(updated_config=True)

0 comments on commit 2a6c948

Please sign in to comment.