Commits

Olemis Lang  committed 4aec905

BH Multiproduct #387 : Enhanced tracking of user logins to prevent failures

  • Participants
  • Parent commits af28c32
  • Branches t387_test_functional

Comments (0)

Files changed (1)

File t387/t387_r1526822_functional_test.8.diff

 
 diff -r 52a8c6115edd bloodhound_multiproduct/tests/functional/__init__.py
 --- a/bloodhound_multiproduct/tests/functional/__init__.py	Tue Oct 01 21:24:09 2013 -0500
-+++ b/bloodhound_multiproduct/tests/functional/__init__.py	Tue Oct 01 21:27:40 2013 -0500
-@@ -717,6 +717,30 @@
++++ b/bloodhound_multiproduct/tests/functional/__init__.py	Tue Oct 01 21:34:18 2013 -0500
+@@ -717,6 +717,33 @@
          tc.follow('Tickets')
          tc.url(self.url + '/dashboard')
  
 +        @contextlib.contextmanager
 +        def user_ctx():
 +            try:
++                login_ok = False
 +                try:
 +                    self.logout()
 +                except:
 +                    pass
 +                if user:
 +                    self.login(user)
++                    login_ok = True
 +                yield self
 +            finally:
-+                try:
-+                    self.logout()
-+                except:
-+                    pass
++                if login_ok:
++                    try:
++                        self.logout()
++                    except:
++                        pass
 +                if restore:
 +                    self.login(restore)
 +