瀏覽代碼

renaming of tests in user_api

Guénaël Muller 6 年之前
父節點
當前提交
60171c6620
共有 1 個文件被更改,包括 4 次插入5 次删除
  1. 4 5
      tracim/tests/library/test_user_api.py

+ 4 - 5
tracim/tests/library/test_user_api.py 查看文件

5
 import transaction
5
 import transaction
6
 
6
 
7
 from tracim.lib.core.user import UserApi
7
 from tracim.lib.core.user import UserApi
8
-from tracim.models import User
9
 from tracim.tests import DefaultTest
8
 from tracim.tests import DefaultTest
10
 from tracim.tests import eq_
9
 from tracim.tests import eq_
11
 
10
 
49
         eq_(True, api.user_with_email_exists('bibi@bibi'))
48
         eq_(True, api.user_with_email_exists('bibi@bibi'))
50
         eq_(False, api.user_with_email_exists('unknown'))
49
         eq_(False, api.user_with_email_exists('unknown'))
51
 
50
 
52
-    def test_get_one_by_email(self):
51
+    def test_unit__get_one_by_email__ok__nominal_case(self):
53
         api = UserApi(
52
         api = UserApi(
54
             current_user=None,
53
             current_user=None,
55
             session=self.session,
54
             session=self.session,
63
 
62
 
64
         eq_(uid, api.get_one_by_email('bibi@bibi').user_id)
63
         eq_(uid, api.get_one_by_email('bibi@bibi').user_id)
65
 
64
 
66
-    def test_get_one_by_email_exception(self):
65
+    def test_unit__get_one_by_email__ok__user_not_found(self):
67
         api = UserApi(
66
         api = UserApi(
68
             current_user=None,
67
             current_user=None,
69
             session=self.session,
68
             session=self.session,
72
         with pytest.raises(NoResultFound):
71
         with pytest.raises(NoResultFound):
73
             api.get_one_by_email('unknown')
72
             api.get_one_by_email('unknown')
74
 
73
 
75
-    def test_get_all(self):
74
+    def test_unit__get_all__ok__nominal_case(self):
76
         api = UserApi(
75
         api = UserApi(
77
             current_user=None,
76
             current_user=None,
78
             session=self.session,
77
             session=self.session,
84
         # u1 + Admin user from BaseFixture
83
         # u1 + Admin user from BaseFixture
85
         assert 2 == len(users)
84
         assert 2 == len(users)
86
 
85
 
87
-    def test_get_one(self):
86
+    def test_unit__get_one__ok__nominal_case(self):
88
         api = UserApi(
87
         api = UserApi(
89
             current_user=None,
88
             current_user=None,
90
             session=self.session,
89
             session=self.session,