use py.test to replace nose, because nose bad documents; add some tests for apps.py