Skip to content

Test framework

Taras Semenenko edited this page Mar 2, 2016 · 3 revisions

Test environment objects

Following objects are created within environment automatically, thus there is no need to use any of fixtures manually. Get necessary Project, Language, TP, Store, Directory via Django ORM After every test DB changes will be rolled back.

Users fixtures:

  • system
  • default
  • nobody
  • member
  • member2

Parametrize test with site_users (all), request_users (system is excluded) if it is necessary to test for different users.

Languages:

  • en
  • language0
  • language1

If templates language is necessary, use the separate fixture.

Projects:

  • project0
  • project1
  • terminology (empty project)
  • disabled_project0

TPs:

  • /language0/project0
  • /language1/project1
  • /language0/project0
  • /language1/project1
  • /language0/disabled_project0

TP structure:

  • /language0/project0/
    • subdir0/
      • store3.po
      • store4.po
    • subdir1/
      • store5.po
    • store0.po

Store structure:

  • 2 untranslated units
  • 2 translated units
  • 2 fuzzy units
  • 2 obsolete units

Submissions:

Suggestions:

VirtualFolders:

  • virtualfolder0 (location: /{LANG}/{PROJ}/, filter_rules: store0.po)
  • virtualfolder1 (location: /{LANG}/{PROJ}/, filter_rules: store1.po)
  • virtualfolder2 (location: /{LANG}/project0/, filter_rules: store0.po)
  • virtualfolder3 (location: /{LANG}/project0/, filter_rules: store1.po)
  • virtualfolder4 (location: /language0/project0/, filter_rules: subdir0/store4.po)

Some concerns and questions

  • Avoid (session scope) fixtures which parse data/po directory content
  • Use temporary test dir for uploading content
  • What should be source of this content? (I would prefer auto generated content)
  • How to test update_store_from_disk?
  • How to test sync when FS can be changed?
Clone this wiki locally