[Checkins] SVN: zc.authorizedotnet/trunk/src/zc/authorizedotnet/ Got rid of the screenscraping checks that the transaction state transitions

Albertas Agejevas alga at pov.lt
Thu May 3 15:20:38 EDT 2007


Log message for revision 75070:
  Got rid of the screenscraping checks that the transaction state transitions
  were successful.  The screenscraping server started failing because
  http://test.authorize.net/robots.txt denies any access to robots.
  

Changed:
  U   zc.authorizedotnet/trunk/src/zc/authorizedotnet/README.txt
  U   zc.authorizedotnet/trunk/src/zc/authorizedotnet/tests.py

-=-
Modified: zc.authorizedotnet/trunk/src/zc/authorizedotnet/README.txt
===================================================================
--- zc.authorizedotnet/trunk/src/zc/authorizedotnet/README.txt	2007-05-03 19:17:33 UTC (rev 75069)
+++ zc.authorizedotnet/trunk/src/zc/authorizedotnet/README.txt	2007-05-03 19:20:37 UTC (rev 75070)
@@ -58,13 +58,7 @@
     >>> result.trans_id
     '123456789'
 
-The server successfully processed the transaction:
 
-    >>> transactions = server.getTransactions()
-    >>> transactions[result.trans_id]
-    'Authorized/Pending Capture'
-
-
 Capturing Authorized Transactions
 ---------------------------------
 
@@ -75,14 +69,7 @@
     >>> result.response
     'approved'
 
-The server shows that the transaction has been captured and is awaiting
-settlement:
 
-    >>> transactions = server.getTransactions()
-    >>> transactions[result.trans_id]
-    'Captured/Pending Settlement'
-
-
 Credit (refund) transactions
 ----------------------------
 
@@ -116,13 +103,7 @@
     >>> result.response
     'approved'
 
-The server shows that the transaction was voided:
 
-    >>> transactions = server.getTransactions()
-    >>> transactions[auth_trans_id]
-    'Voided'
-
-
 Transaction Errors
 ------------------
 

Modified: zc.authorizedotnet/trunk/src/zc/authorizedotnet/tests.py
===================================================================
--- zc.authorizedotnet/trunk/src/zc/authorizedotnet/tests.py	2007-05-03 19:17:33 UTC (rev 75069)
+++ zc.authorizedotnet/trunk/src/zc/authorizedotnet/tests.py	2007-05-03 19:20:37 UTC (rev 75070)
@@ -58,39 +58,7 @@
 
     return mech_browser
 
-class ScrapedMerchantUiServer(object):
-    initialized = False
 
-    def __init__(self, server, login, password):
-        mech_browser = makeMechBrowser()
-        login_page = 'https://%s/ui/themes/anet/merch.app' % server
-        self.browser = Browser(mech_browser=mech_browser)
-        self.browser.open(login_page)
-        self.browser.getControl(name='MerchantLogin').value = login
-        self.browser.getControl(name='Password').value = password
-        self.browser.getControl('Log In').click()
-
-        # We have to skip a stupid nag screen.
-        self.browser.getControl('Skip').click()
-
-    def getTransactions(self):
-        self.browser.getLink('Unsettled Transactions').click()
-        soup = BeautifulSoup(self.browser.contents)
-        transactions = {}
-        for row in soup('tr', ['SearchLineItemRow1', 'SearchLineItemRow2']):
-            cells = row('td')
-            if len(cells) == 8:
-                txn_id = cells[0].contents[0].contents[0]
-                txn_status = cells[2].contents[0]
-                transactions[txn_id] = txn_status
-        self.browser.goBack()
-
-        return transactions
-
-    def close(self):
-        self.browser.mech_browser.close()
-
-
 class InProcessServer(object):
     info = {}
     last_transaction_id = 0
@@ -269,16 +237,10 @@
                            ' provided in order to run the zc.authorizedotnet'
                            ' tests against the Authorize.Net test server.')
 
-    test.globs['server'] = ScrapedMerchantUiServer('test.authorize.net', login,
-                                                   password)
     test.globs['LOGIN'] = login
     test.globs['KEY'] = key
 
 
-
-def remoteTearDown(test):
-    test.globs['server'].close()
-
 def test_suite():
     checker = renormalizing.RENormalizing([
         (re.compile(r"'.{6}'"), "'123456'"), # for approval codes
@@ -293,13 +255,11 @@
             optionflags = doctest.NORMALIZE_WHITESPACE | doctest.ELLIPSIS,
             checker = checker,
             setUp = remoteSetUp,
-            tearDown = remoteTearDown,
             )
     remote.level = 5
     local = doctest.DocFileSuite(
             'README.txt',
             globs = dict(
-                server=in_process_server,
                 SERVER_NAME='localhost:%s' % TEST_SERVER_PORT,
                 ),
             optionflags = doctest.NORMALIZE_WHITESPACE | doctest.ELLIPSIS,



More information about the Checkins mailing list