Mercurial > kallithea
annotate rhodecode/tests/functional/test_admin.py @ 3089:4cc9bb83ecb4 beta
Fixed some issues with edit form
- unified code (but still a lot of duplicated code left over)
- fixed forms
- fixed validators
author | Marcin Kuzminski <marcin@python-works.com> |
---|---|
date | Thu, 13 Dec 2012 03:34:19 +0100 |
parents | 09cef303962b |
children | 7e5f8c12a3fc |
rev | line source |
---|---|
3071
7b0c19b00629
python 2.5 tests fix
Marcin Kuzminski <marcin@python-works.com>
parents:
3070
diff
changeset
|
1 from __future__ import with_statement |
3063
ca2b21819dfd
Implemented better support for Wildcard queries
Marcin Kuzminski <marcin@python-works.com>
parents:
628
diff
changeset
|
2 import os |
ca2b21819dfd
Implemented better support for Wildcard queries
Marcin Kuzminski <marcin@python-works.com>
parents:
628
diff
changeset
|
3 import csv |
ca2b21819dfd
Implemented better support for Wildcard queries
Marcin Kuzminski <marcin@python-works.com>
parents:
628
diff
changeset
|
4 import datetime |
547
1e757ac98988
renamed project to rhodecode
Marcin Kuzminski <marcin@python-works.com>
parents:
473
diff
changeset
|
5 from rhodecode.tests import * |
3063
ca2b21819dfd
Implemented better support for Wildcard queries
Marcin Kuzminski <marcin@python-works.com>
parents:
628
diff
changeset
|
6 from rhodecode.model.db import UserLog |
ca2b21819dfd
Implemented better support for Wildcard queries
Marcin Kuzminski <marcin@python-works.com>
parents:
628
diff
changeset
|
7 from rhodecode.model.meta import Session |
ca2b21819dfd
Implemented better support for Wildcard queries
Marcin Kuzminski <marcin@python-works.com>
parents:
628
diff
changeset
|
8 from rhodecode.lib.utils2 import safe_unicode |
ca2b21819dfd
Implemented better support for Wildcard queries
Marcin Kuzminski <marcin@python-works.com>
parents:
628
diff
changeset
|
9 |
ca2b21819dfd
Implemented better support for Wildcard queries
Marcin Kuzminski <marcin@python-works.com>
parents:
628
diff
changeset
|
10 dn = os.path.dirname |
ca2b21819dfd
Implemented better support for Wildcard queries
Marcin Kuzminski <marcin@python-works.com>
parents:
628
diff
changeset
|
11 FIXTURES = os.path.join(dn(dn(os.path.abspath(__file__))), 'fixtures') |
ca2b21819dfd
Implemented better support for Wildcard queries
Marcin Kuzminski <marcin@python-works.com>
parents:
628
diff
changeset
|
12 |
43 | 13 |
14 class TestAdminController(TestController): | |
15 | |
3063
ca2b21819dfd
Implemented better support for Wildcard queries
Marcin Kuzminski <marcin@python-works.com>
parents:
628
diff
changeset
|
16 @classmethod |
ca2b21819dfd
Implemented better support for Wildcard queries
Marcin Kuzminski <marcin@python-works.com>
parents:
628
diff
changeset
|
17 def setup_class(cls): |
ca2b21819dfd
Implemented better support for Wildcard queries
Marcin Kuzminski <marcin@python-works.com>
parents:
628
diff
changeset
|
18 UserLog.query().delete() |
ca2b21819dfd
Implemented better support for Wildcard queries
Marcin Kuzminski <marcin@python-works.com>
parents:
628
diff
changeset
|
19 Session().commit() |
3074
09cef303962b
python2.5 safe parsing of datetime string with microseconds
Marcin Kuzminski <marcin@python-works.com>
parents:
3072
diff
changeset
|
20 |
09cef303962b
python2.5 safe parsing of datetime string with microseconds
Marcin Kuzminski <marcin@python-works.com>
parents:
3072
diff
changeset
|
21 def strptime(val): |
09cef303962b
python2.5 safe parsing of datetime string with microseconds
Marcin Kuzminski <marcin@python-works.com>
parents:
3072
diff
changeset
|
22 fmt = '%Y-%m-%d %H:%M:%S' |
09cef303962b
python2.5 safe parsing of datetime string with microseconds
Marcin Kuzminski <marcin@python-works.com>
parents:
3072
diff
changeset
|
23 if '.' not in val: |
09cef303962b
python2.5 safe parsing of datetime string with microseconds
Marcin Kuzminski <marcin@python-works.com>
parents:
3072
diff
changeset
|
24 return datetime.datetime.strptime(val, fmt) |
09cef303962b
python2.5 safe parsing of datetime string with microseconds
Marcin Kuzminski <marcin@python-works.com>
parents:
3072
diff
changeset
|
25 |
09cef303962b
python2.5 safe parsing of datetime string with microseconds
Marcin Kuzminski <marcin@python-works.com>
parents:
3072
diff
changeset
|
26 nofrag, frag = val.split(".") |
09cef303962b
python2.5 safe parsing of datetime string with microseconds
Marcin Kuzminski <marcin@python-works.com>
parents:
3072
diff
changeset
|
27 date = datetime.datetime.strptime(nofrag, fmt) |
09cef303962b
python2.5 safe parsing of datetime string with microseconds
Marcin Kuzminski <marcin@python-works.com>
parents:
3072
diff
changeset
|
28 |
09cef303962b
python2.5 safe parsing of datetime string with microseconds
Marcin Kuzminski <marcin@python-works.com>
parents:
3072
diff
changeset
|
29 frag = frag[:6] # truncate to microseconds |
09cef303962b
python2.5 safe parsing of datetime string with microseconds
Marcin Kuzminski <marcin@python-works.com>
parents:
3072
diff
changeset
|
30 frag += (6 - len(frag)) * '0' # add 0s |
09cef303962b
python2.5 safe parsing of datetime string with microseconds
Marcin Kuzminski <marcin@python-works.com>
parents:
3072
diff
changeset
|
31 return date.replace(microsecond=int(frag)) |
09cef303962b
python2.5 safe parsing of datetime string with microseconds
Marcin Kuzminski <marcin@python-works.com>
parents:
3072
diff
changeset
|
32 |
3063
ca2b21819dfd
Implemented better support for Wildcard queries
Marcin Kuzminski <marcin@python-works.com>
parents:
628
diff
changeset
|
33 with open(os.path.join(FIXTURES, 'journal_dump.csv')) as f: |
ca2b21819dfd
Implemented better support for Wildcard queries
Marcin Kuzminski <marcin@python-works.com>
parents:
628
diff
changeset
|
34 for row in csv.DictReader(f): |
ca2b21819dfd
Implemented better support for Wildcard queries
Marcin Kuzminski <marcin@python-works.com>
parents:
628
diff
changeset
|
35 ul = UserLog() |
ca2b21819dfd
Implemented better support for Wildcard queries
Marcin Kuzminski <marcin@python-works.com>
parents:
628
diff
changeset
|
36 for k, v in row.iteritems(): |
ca2b21819dfd
Implemented better support for Wildcard queries
Marcin Kuzminski <marcin@python-works.com>
parents:
628
diff
changeset
|
37 v = safe_unicode(v) |
ca2b21819dfd
Implemented better support for Wildcard queries
Marcin Kuzminski <marcin@python-works.com>
parents:
628
diff
changeset
|
38 if k == 'action_date': |
3074
09cef303962b
python2.5 safe parsing of datetime string with microseconds
Marcin Kuzminski <marcin@python-works.com>
parents:
3072
diff
changeset
|
39 v = strptime(v) |
3072
86e087bd75ce
fixed tests, made the journal filter consistent accross different databases
Marcin Kuzminski <marcin@python-works.com>
parents:
3071
diff
changeset
|
40 if k in ['user_id', 'repository_id']: |
3074
09cef303962b
python2.5 safe parsing of datetime string with microseconds
Marcin Kuzminski <marcin@python-works.com>
parents:
3072
diff
changeset
|
41 # nullable due to FK problems |
3072
86e087bd75ce
fixed tests, made the journal filter consistent accross different databases
Marcin Kuzminski <marcin@python-works.com>
parents:
3071
diff
changeset
|
42 v = None |
3063
ca2b21819dfd
Implemented better support for Wildcard queries
Marcin Kuzminski <marcin@python-works.com>
parents:
628
diff
changeset
|
43 setattr(ul, k, v) |
ca2b21819dfd
Implemented better support for Wildcard queries
Marcin Kuzminski <marcin@python-works.com>
parents:
628
diff
changeset
|
44 Session().add(ul) |
ca2b21819dfd
Implemented better support for Wildcard queries
Marcin Kuzminski <marcin@python-works.com>
parents:
628
diff
changeset
|
45 Session().commit() |
ca2b21819dfd
Implemented better support for Wildcard queries
Marcin Kuzminski <marcin@python-works.com>
parents:
628
diff
changeset
|
46 |
ca2b21819dfd
Implemented better support for Wildcard queries
Marcin Kuzminski <marcin@python-works.com>
parents:
628
diff
changeset
|
47 @classmethod |
ca2b21819dfd
Implemented better support for Wildcard queries
Marcin Kuzminski <marcin@python-works.com>
parents:
628
diff
changeset
|
48 def teardown_class(cls): |
ca2b21819dfd
Implemented better support for Wildcard queries
Marcin Kuzminski <marcin@python-works.com>
parents:
628
diff
changeset
|
49 UserLog.query().delete() |
ca2b21819dfd
Implemented better support for Wildcard queries
Marcin Kuzminski <marcin@python-works.com>
parents:
628
diff
changeset
|
50 Session().commit() |
ca2b21819dfd
Implemented better support for Wildcard queries
Marcin Kuzminski <marcin@python-works.com>
parents:
628
diff
changeset
|
51 |
43 | 52 def test_index(self): |
473
6b934c9607e7
Improved testing scenarios. Made test env creator
Marcin Kuzminski <marcin@python-works.com>
parents:
459
diff
changeset
|
53 self.log_user() |
459
7c978511c951
implemented basic (startup) nose test suite.
Marcin Kuzminski <marcin@python-works.com>
parents:
43
diff
changeset
|
54 response = self.app.get(url(controller='admin/admin', action='index')) |
3063
ca2b21819dfd
Implemented better support for Wildcard queries
Marcin Kuzminski <marcin@python-works.com>
parents:
628
diff
changeset
|
55 response.mustcontain('Admin journal') |
ca2b21819dfd
Implemented better support for Wildcard queries
Marcin Kuzminski <marcin@python-works.com>
parents:
628
diff
changeset
|
56 |
ca2b21819dfd
Implemented better support for Wildcard queries
Marcin Kuzminski <marcin@python-works.com>
parents:
628
diff
changeset
|
57 def test_filter_all_entries(self): |
ca2b21819dfd
Implemented better support for Wildcard queries
Marcin Kuzminski <marcin@python-works.com>
parents:
628
diff
changeset
|
58 self.log_user() |
ca2b21819dfd
Implemented better support for Wildcard queries
Marcin Kuzminski <marcin@python-works.com>
parents:
628
diff
changeset
|
59 response = self.app.get(url(controller='admin/admin', action='index',)) |
ca2b21819dfd
Implemented better support for Wildcard queries
Marcin Kuzminski <marcin@python-works.com>
parents:
628
diff
changeset
|
60 response.mustcontain('2034 entries') |
ca2b21819dfd
Implemented better support for Wildcard queries
Marcin Kuzminski <marcin@python-works.com>
parents:
628
diff
changeset
|
61 |
ca2b21819dfd
Implemented better support for Wildcard queries
Marcin Kuzminski <marcin@python-works.com>
parents:
628
diff
changeset
|
62 def test_filter_journal_filter_exact_match_on_repository(self): |
ca2b21819dfd
Implemented better support for Wildcard queries
Marcin Kuzminski <marcin@python-works.com>
parents:
628
diff
changeset
|
63 self.log_user() |
ca2b21819dfd
Implemented better support for Wildcard queries
Marcin Kuzminski <marcin@python-works.com>
parents:
628
diff
changeset
|
64 response = self.app.get(url(controller='admin/admin', action='index', |
ca2b21819dfd
Implemented better support for Wildcard queries
Marcin Kuzminski <marcin@python-works.com>
parents:
628
diff
changeset
|
65 filter='repository:rhodecode')) |
ca2b21819dfd
Implemented better support for Wildcard queries
Marcin Kuzminski <marcin@python-works.com>
parents:
628
diff
changeset
|
66 response.mustcontain('3 entries') |
ca2b21819dfd
Implemented better support for Wildcard queries
Marcin Kuzminski <marcin@python-works.com>
parents:
628
diff
changeset
|
67 |
3072
86e087bd75ce
fixed tests, made the journal filter consistent accross different databases
Marcin Kuzminski <marcin@python-works.com>
parents:
3071
diff
changeset
|
68 def test_filter_journal_filter_exact_match_on_repository_CamelCase(self): |
86e087bd75ce
fixed tests, made the journal filter consistent accross different databases
Marcin Kuzminski <marcin@python-works.com>
parents:
3071
diff
changeset
|
69 self.log_user() |
86e087bd75ce
fixed tests, made the journal filter consistent accross different databases
Marcin Kuzminski <marcin@python-works.com>
parents:
3071
diff
changeset
|
70 response = self.app.get(url(controller='admin/admin', action='index', |
86e087bd75ce
fixed tests, made the journal filter consistent accross different databases
Marcin Kuzminski <marcin@python-works.com>
parents:
3071
diff
changeset
|
71 filter='repository:RhodeCode')) |
86e087bd75ce
fixed tests, made the journal filter consistent accross different databases
Marcin Kuzminski <marcin@python-works.com>
parents:
3071
diff
changeset
|
72 response.mustcontain('3 entries') |
86e087bd75ce
fixed tests, made the journal filter consistent accross different databases
Marcin Kuzminski <marcin@python-works.com>
parents:
3071
diff
changeset
|
73 |
3063
ca2b21819dfd
Implemented better support for Wildcard queries
Marcin Kuzminski <marcin@python-works.com>
parents:
628
diff
changeset
|
74 def test_filter_journal_filter_wildcard_on_repository(self): |
ca2b21819dfd
Implemented better support for Wildcard queries
Marcin Kuzminski <marcin@python-works.com>
parents:
628
diff
changeset
|
75 self.log_user() |
ca2b21819dfd
Implemented better support for Wildcard queries
Marcin Kuzminski <marcin@python-works.com>
parents:
628
diff
changeset
|
76 response = self.app.get(url(controller='admin/admin', action='index', |
ca2b21819dfd
Implemented better support for Wildcard queries
Marcin Kuzminski <marcin@python-works.com>
parents:
628
diff
changeset
|
77 filter='repository:*test*')) |
ca2b21819dfd
Implemented better support for Wildcard queries
Marcin Kuzminski <marcin@python-works.com>
parents:
628
diff
changeset
|
78 response.mustcontain('862 entries') |
ca2b21819dfd
Implemented better support for Wildcard queries
Marcin Kuzminski <marcin@python-works.com>
parents:
628
diff
changeset
|
79 |
ca2b21819dfd
Implemented better support for Wildcard queries
Marcin Kuzminski <marcin@python-works.com>
parents:
628
diff
changeset
|
80 def test_filter_journal_filter_prefix_on_repository(self): |
ca2b21819dfd
Implemented better support for Wildcard queries
Marcin Kuzminski <marcin@python-works.com>
parents:
628
diff
changeset
|
81 self.log_user() |
ca2b21819dfd
Implemented better support for Wildcard queries
Marcin Kuzminski <marcin@python-works.com>
parents:
628
diff
changeset
|
82 response = self.app.get(url(controller='admin/admin', action='index', |
ca2b21819dfd
Implemented better support for Wildcard queries
Marcin Kuzminski <marcin@python-works.com>
parents:
628
diff
changeset
|
83 filter='repository:test*')) |
ca2b21819dfd
Implemented better support for Wildcard queries
Marcin Kuzminski <marcin@python-works.com>
parents:
628
diff
changeset
|
84 response.mustcontain('257 entries') |
ca2b21819dfd
Implemented better support for Wildcard queries
Marcin Kuzminski <marcin@python-works.com>
parents:
628
diff
changeset
|
85 |
3072
86e087bd75ce
fixed tests, made the journal filter consistent accross different databases
Marcin Kuzminski <marcin@python-works.com>
parents:
3071
diff
changeset
|
86 def test_filter_journal_filter_prefix_on_repository_CamelCase(self): |
86e087bd75ce
fixed tests, made the journal filter consistent accross different databases
Marcin Kuzminski <marcin@python-works.com>
parents:
3071
diff
changeset
|
87 self.log_user() |
86e087bd75ce
fixed tests, made the journal filter consistent accross different databases
Marcin Kuzminski <marcin@python-works.com>
parents:
3071
diff
changeset
|
88 response = self.app.get(url(controller='admin/admin', action='index', |
86e087bd75ce
fixed tests, made the journal filter consistent accross different databases
Marcin Kuzminski <marcin@python-works.com>
parents:
3071
diff
changeset
|
89 filter='repository:Test*')) |
86e087bd75ce
fixed tests, made the journal filter consistent accross different databases
Marcin Kuzminski <marcin@python-works.com>
parents:
3071
diff
changeset
|
90 response.mustcontain('257 entries') |
86e087bd75ce
fixed tests, made the journal filter consistent accross different databases
Marcin Kuzminski <marcin@python-works.com>
parents:
3071
diff
changeset
|
91 |
3063
ca2b21819dfd
Implemented better support for Wildcard queries
Marcin Kuzminski <marcin@python-works.com>
parents:
628
diff
changeset
|
92 def test_filter_journal_filter_prefix_on_repository_and_user(self): |
ca2b21819dfd
Implemented better support for Wildcard queries
Marcin Kuzminski <marcin@python-works.com>
parents:
628
diff
changeset
|
93 self.log_user() |
ca2b21819dfd
Implemented better support for Wildcard queries
Marcin Kuzminski <marcin@python-works.com>
parents:
628
diff
changeset
|
94 response = self.app.get(url(controller='admin/admin', action='index', |
ca2b21819dfd
Implemented better support for Wildcard queries
Marcin Kuzminski <marcin@python-works.com>
parents:
628
diff
changeset
|
95 filter='repository:test* AND username:demo')) |
ca2b21819dfd
Implemented better support for Wildcard queries
Marcin Kuzminski <marcin@python-works.com>
parents:
628
diff
changeset
|
96 response.mustcontain('130 entries') |
ca2b21819dfd
Implemented better support for Wildcard queries
Marcin Kuzminski <marcin@python-works.com>
parents:
628
diff
changeset
|
97 |
ca2b21819dfd
Implemented better support for Wildcard queries
Marcin Kuzminski <marcin@python-works.com>
parents:
628
diff
changeset
|
98 def test_filter_journal_filter_prefix_on_repository_or_other_repo(self): |
ca2b21819dfd
Implemented better support for Wildcard queries
Marcin Kuzminski <marcin@python-works.com>
parents:
628
diff
changeset
|
99 self.log_user() |
ca2b21819dfd
Implemented better support for Wildcard queries
Marcin Kuzminski <marcin@python-works.com>
parents:
628
diff
changeset
|
100 response = self.app.get(url(controller='admin/admin', action='index', |
ca2b21819dfd
Implemented better support for Wildcard queries
Marcin Kuzminski <marcin@python-works.com>
parents:
628
diff
changeset
|
101 filter='repository:test* OR repository:rhodecode')) |
ca2b21819dfd
Implemented better support for Wildcard queries
Marcin Kuzminski <marcin@python-works.com>
parents:
628
diff
changeset
|
102 response.mustcontain('260 entries') # 257 + 3 |
ca2b21819dfd
Implemented better support for Wildcard queries
Marcin Kuzminski <marcin@python-works.com>
parents:
628
diff
changeset
|
103 |
ca2b21819dfd
Implemented better support for Wildcard queries
Marcin Kuzminski <marcin@python-works.com>
parents:
628
diff
changeset
|
104 def test_filter_journal_filter_exact_match_on_username(self): |
ca2b21819dfd
Implemented better support for Wildcard queries
Marcin Kuzminski <marcin@python-works.com>
parents:
628
diff
changeset
|
105 self.log_user() |
ca2b21819dfd
Implemented better support for Wildcard queries
Marcin Kuzminski <marcin@python-works.com>
parents:
628
diff
changeset
|
106 response = self.app.get(url(controller='admin/admin', action='index', |
ca2b21819dfd
Implemented better support for Wildcard queries
Marcin Kuzminski <marcin@python-works.com>
parents:
628
diff
changeset
|
107 filter='username:demo')) |
ca2b21819dfd
Implemented better support for Wildcard queries
Marcin Kuzminski <marcin@python-works.com>
parents:
628
diff
changeset
|
108 response.mustcontain('1087 entries') |
ca2b21819dfd
Implemented better support for Wildcard queries
Marcin Kuzminski <marcin@python-works.com>
parents:
628
diff
changeset
|
109 |
3072
86e087bd75ce
fixed tests, made the journal filter consistent accross different databases
Marcin Kuzminski <marcin@python-works.com>
parents:
3071
diff
changeset
|
110 def test_filter_journal_filter_exact_match_on_username_camelCase(self): |
86e087bd75ce
fixed tests, made the journal filter consistent accross different databases
Marcin Kuzminski <marcin@python-works.com>
parents:
3071
diff
changeset
|
111 self.log_user() |
86e087bd75ce
fixed tests, made the journal filter consistent accross different databases
Marcin Kuzminski <marcin@python-works.com>
parents:
3071
diff
changeset
|
112 response = self.app.get(url(controller='admin/admin', action='index', |
86e087bd75ce
fixed tests, made the journal filter consistent accross different databases
Marcin Kuzminski <marcin@python-works.com>
parents:
3071
diff
changeset
|
113 filter='username:DemO')) |
86e087bd75ce
fixed tests, made the journal filter consistent accross different databases
Marcin Kuzminski <marcin@python-works.com>
parents:
3071
diff
changeset
|
114 response.mustcontain('1087 entries') |
86e087bd75ce
fixed tests, made the journal filter consistent accross different databases
Marcin Kuzminski <marcin@python-works.com>
parents:
3071
diff
changeset
|
115 |
3063
ca2b21819dfd
Implemented better support for Wildcard queries
Marcin Kuzminski <marcin@python-works.com>
parents:
628
diff
changeset
|
116 def test_filter_journal_filter_wildcard_on_username(self): |
ca2b21819dfd
Implemented better support for Wildcard queries
Marcin Kuzminski <marcin@python-works.com>
parents:
628
diff
changeset
|
117 self.log_user() |
ca2b21819dfd
Implemented better support for Wildcard queries
Marcin Kuzminski <marcin@python-works.com>
parents:
628
diff
changeset
|
118 response = self.app.get(url(controller='admin/admin', action='index', |
ca2b21819dfd
Implemented better support for Wildcard queries
Marcin Kuzminski <marcin@python-works.com>
parents:
628
diff
changeset
|
119 filter='username:*test*')) |
ca2b21819dfd
Implemented better support for Wildcard queries
Marcin Kuzminski <marcin@python-works.com>
parents:
628
diff
changeset
|
120 response.mustcontain('100 entries') |
ca2b21819dfd
Implemented better support for Wildcard queries
Marcin Kuzminski <marcin@python-works.com>
parents:
628
diff
changeset
|
121 |
ca2b21819dfd
Implemented better support for Wildcard queries
Marcin Kuzminski <marcin@python-works.com>
parents:
628
diff
changeset
|
122 def test_filter_journal_filter_prefix_on_username(self): |
ca2b21819dfd
Implemented better support for Wildcard queries
Marcin Kuzminski <marcin@python-works.com>
parents:
628
diff
changeset
|
123 self.log_user() |
ca2b21819dfd
Implemented better support for Wildcard queries
Marcin Kuzminski <marcin@python-works.com>
parents:
628
diff
changeset
|
124 response = self.app.get(url(controller='admin/admin', action='index', |
ca2b21819dfd
Implemented better support for Wildcard queries
Marcin Kuzminski <marcin@python-works.com>
parents:
628
diff
changeset
|
125 filter='username:demo*')) |
ca2b21819dfd
Implemented better support for Wildcard queries
Marcin Kuzminski <marcin@python-works.com>
parents:
628
diff
changeset
|
126 response.mustcontain('1101 entries') |
ca2b21819dfd
Implemented better support for Wildcard queries
Marcin Kuzminski <marcin@python-works.com>
parents:
628
diff
changeset
|
127 |
ca2b21819dfd
Implemented better support for Wildcard queries
Marcin Kuzminski <marcin@python-works.com>
parents:
628
diff
changeset
|
128 def test_filter_journal_filter_prefix_on_user_or_other_user(self): |
ca2b21819dfd
Implemented better support for Wildcard queries
Marcin Kuzminski <marcin@python-works.com>
parents:
628
diff
changeset
|
129 self.log_user() |
ca2b21819dfd
Implemented better support for Wildcard queries
Marcin Kuzminski <marcin@python-works.com>
parents:
628
diff
changeset
|
130 response = self.app.get(url(controller='admin/admin', action='index', |
ca2b21819dfd
Implemented better support for Wildcard queries
Marcin Kuzminski <marcin@python-works.com>
parents:
628
diff
changeset
|
131 filter='username:demo OR username:volcan')) |
ca2b21819dfd
Implemented better support for Wildcard queries
Marcin Kuzminski <marcin@python-works.com>
parents:
628
diff
changeset
|
132 response.mustcontain('1095 entries') # 1087 + 8 |
ca2b21819dfd
Implemented better support for Wildcard queries
Marcin Kuzminski <marcin@python-works.com>
parents:
628
diff
changeset
|
133 |
ca2b21819dfd
Implemented better support for Wildcard queries
Marcin Kuzminski <marcin@python-works.com>
parents:
628
diff
changeset
|
134 def test_filter_journal_filter_wildcard_on_action(self): |
ca2b21819dfd
Implemented better support for Wildcard queries
Marcin Kuzminski <marcin@python-works.com>
parents:
628
diff
changeset
|
135 self.log_user() |
ca2b21819dfd
Implemented better support for Wildcard queries
Marcin Kuzminski <marcin@python-works.com>
parents:
628
diff
changeset
|
136 response = self.app.get(url(controller='admin/admin', action='index', |
ca2b21819dfd
Implemented better support for Wildcard queries
Marcin Kuzminski <marcin@python-works.com>
parents:
628
diff
changeset
|
137 filter='action:*pull_request*')) |
3070
cc7eedb5323c
final implementation of #210 journal filtering.
Marcin Kuzminski <marcin@python-works.com>
parents:
3063
diff
changeset
|
138 response.mustcontain('187 entries') |
cc7eedb5323c
final implementation of #210 journal filtering.
Marcin Kuzminski <marcin@python-works.com>
parents:
3063
diff
changeset
|
139 |
cc7eedb5323c
final implementation of #210 journal filtering.
Marcin Kuzminski <marcin@python-works.com>
parents:
3063
diff
changeset
|
140 def test_filter_journal_filter_on_date(self): |
cc7eedb5323c
final implementation of #210 journal filtering.
Marcin Kuzminski <marcin@python-works.com>
parents:
3063
diff
changeset
|
141 self.log_user() |
cc7eedb5323c
final implementation of #210 journal filtering.
Marcin Kuzminski <marcin@python-works.com>
parents:
3063
diff
changeset
|
142 response = self.app.get(url(controller='admin/admin', action='index', |
cc7eedb5323c
final implementation of #210 journal filtering.
Marcin Kuzminski <marcin@python-works.com>
parents:
3063
diff
changeset
|
143 filter='date:20121010')) |
cc7eedb5323c
final implementation of #210 journal filtering.
Marcin Kuzminski <marcin@python-works.com>
parents:
3063
diff
changeset
|
144 response.mustcontain('47 entries') |
cc7eedb5323c
final implementation of #210 journal filtering.
Marcin Kuzminski <marcin@python-works.com>
parents:
3063
diff
changeset
|
145 |
cc7eedb5323c
final implementation of #210 journal filtering.
Marcin Kuzminski <marcin@python-works.com>
parents:
3063
diff
changeset
|
146 def test_filter_journal_filter_on_date_2(self): |
cc7eedb5323c
final implementation of #210 journal filtering.
Marcin Kuzminski <marcin@python-works.com>
parents:
3063
diff
changeset
|
147 self.log_user() |
cc7eedb5323c
final implementation of #210 journal filtering.
Marcin Kuzminski <marcin@python-works.com>
parents:
3063
diff
changeset
|
148 response = self.app.get(url(controller='admin/admin', action='index', |
cc7eedb5323c
final implementation of #210 journal filtering.
Marcin Kuzminski <marcin@python-works.com>
parents:
3063
diff
changeset
|
149 filter='date:20121020')) |
3074
09cef303962b
python2.5 safe parsing of datetime string with microseconds
Marcin Kuzminski <marcin@python-works.com>
parents:
3072
diff
changeset
|
150 response.mustcontain('17 entries') |