• Home
  • About me

Diego Búrigo Zacarão’s Weblog

Let me talk about something

Follow me
Twitter
Posts
Comments
« Transifex using SQLAlchemy, Genshi and ToscaWidgets is ready
SQLAlchemy and Genshi on TG1.0 or TG2? »

Writing test cases for Transifex

Jul 9th, 2008 by diegobz

Last week I wrote some test cases for the new features added in Transifex. I was not used to write them, so I’ve had some challenges to win. After see some Dimitris’s test cases I could figure out how it work. Then, I’ve started to write my own test cases.

Test cases are simple to write. They help to much when we have several people working hardly in the same branch. So, people can pull/push and see if some code, that it has been coded for somebody, breaks anything.

Most of test cases has been written by Dimitris only can test pages (view) that doesn’t need identity. We had a problem with pages where an user should be logged in. Fortunately we could find out a way to solve this problem. BrowsingSession is the way!

class TestModuleTranslator(TestModule):

    """Test how module pages look to a translator."""

    def test_moduleinfo_logged(self):
        """Test access to the Module Submit page"""
        user = testutil.BrowsingSession()
        user.goto('/login?user_name=guest&password=guest&login=Login')
        user.goto(u"/module/%s" % self.testmodule)
        assert 'Submit translations' in user.response

Using BrowsingSession you can browse for any page that need identity and do any test that you want. That’s simple and works fine for any situation that I’ve tested.

The Transifex’s test cases has written until now can be found here. Hopefully we’ll have more soon! :)

Posted in English, Fedora, GSoC, Transifex

Comments are closed.

  • Recent Posts

    • Enabling apache UserDir (public_html) with SELinux enabled on Fedora
    • Metallica, Porto Alegre, Brasil – 28/01/2010
    • It’s been 1 year of Indifex
    • Running Transifex with PostgreSQL on Fedora
    • Unicode usernames in Django admin panel
    • Where do people in my blog come from?
  • Twitter Updates

      more updates...
    • Translate this page

    • Categories

      • Django (5)
      • English (45)
      • Europe (18)
      • Event (6)
      • Fedora (47)
      • FISL (5)
      • FUDCon (5)
      • GSoC (11)
      • Indifex (1)
      • Mini-post (5)
      • Photos (12)
      • PHP (1)
      • Português (14)
      • SELinux (1)
      • Transifex (30)

    Diego Búrigo Zacarão’s Weblog © 2008-2010 All Rights Reserved.

    Cool WordPress Themes | WordPress Rocks!