Show More
@@ -17,6 +17,7 b'' | |||||
17 | # This program is dual-licensed. If you wish to learn more about the |
|
17 | # This program is dual-licensed. If you wish to learn more about the | |
18 | # RhodeCode Enterprise Edition, including its added features, Support services, |
|
18 | # RhodeCode Enterprise Edition, including its added features, Support services, | |
19 | # and proprietary license terms, please see https://rhodecode.com/licenses/ |
|
19 | # and proprietary license terms, please see https://rhodecode.com/licenses/ | |
|
20 | ||||
20 | import pytest |
|
21 | import pytest | |
21 | from rhodecode.model.auth_token import AuthTokenModel |
|
22 | from rhodecode.model.auth_token import AuthTokenModel | |
22 | from rhodecode.tests import TestController |
|
23 | from rhodecode.tests import TestController | |
@@ -40,16 +41,17 b' class TestFeedView(TestController):' | |||||
40 | @pytest.mark.parametrize("feed_type,response_types,content_type",[ |
|
41 | @pytest.mark.parametrize("feed_type,response_types,content_type",[ | |
41 | ('rss', ['<rss version="2.0">'], |
|
42 | ('rss', ['<rss version="2.0">'], | |
42 | "application/rss+xml"), |
|
43 | "application/rss+xml"), | |
43 |
('atom', [' |
|
44 | ('atom', ['xmlns="http://www.w3.org/2005/Atom"', 'xml:lang="en-us"'], | |
44 | "application/atom+xml"), |
|
45 | "application/atom+xml"), | |
45 | ]) |
|
46 | ]) | |
46 | def test_feed(self, backend, feed_type, response_types, content_type): |
|
47 | def test_feed(self, backend, feed_type, response_types, content_type): | |
47 | self.log_user() |
|
48 | self.log_user() | |
48 | response = self.app.get( |
|
49 | response = self.app.get( | |
49 |
route_path('{}_feed_home'.format(feed_type), |
|
50 | route_path('{}_feed_home'.format(feed_type), | |
|
51 | repo_name=backend.repo_name)) | |||
50 |
|
52 | |||
51 | for content in response_types: |
|
53 | for content in response_types: | |
52 | assert content in response |
|
54 | response.mustcontain(content) | |
53 |
|
55 | |||
54 | assert response.content_type == content_type |
|
56 | assert response.content_type == content_type | |
55 |
|
57 | |||
@@ -64,7 +66,8 b' class TestFeedView(TestController):' | |||||
64 |
|
66 | |||
65 | response = self.app.get( |
|
67 | response = self.app.get( | |
66 | route_path( |
|
68 | route_path( | |
67 |
'{}_feed_home'.format(feed_type), |
|
69 | '{}_feed_home'.format(feed_type), | |
|
70 | repo_name=backend.repo_name, | |||
68 | params=dict(auth_token=auth_token)), |
|
71 | params=dict(auth_token=auth_token)), | |
69 | status=200) |
|
72 | status=200) | |
70 |
|
73 | |||
@@ -80,7 +83,8 b' class TestFeedView(TestController):' | |||||
80 |
|
83 | |||
81 | self.app.get( |
|
84 | self.app.get( | |
82 | route_path( |
|
85 | route_path( | |
83 |
'{}_feed_home'.format(feed_type), |
|
86 | '{}_feed_home'.format(feed_type), | |
|
87 | repo_name=backend.repo_name, | |||
84 | params=dict(auth_token=auth_token)), |
|
88 | params=dict(auth_token=auth_token)), | |
85 | status=302) |
|
89 | status=302) | |
86 |
|
90 | |||
@@ -89,6 +93,7 b' class TestFeedView(TestController):' | |||||
89 | auth_token = auth_token.api_key |
|
93 | auth_token = auth_token.api_key | |
90 | self.app.get( |
|
94 | self.app.get( | |
91 | route_path( |
|
95 | route_path( | |
92 |
'{}_feed_home'.format(feed_type), |
|
96 | '{}_feed_home'.format(feed_type), | |
|
97 | repo_name=backend.repo_name, | |||
93 | params=dict(auth_token=auth_token)), |
|
98 | params=dict(auth_token=auth_token)), | |
94 | status=200) |
|
99 | status=200) |
@@ -84,7 +84,7 b' class UserLog(Base):' | |||||
84 | __table_args__ = {'useexisting':True} |
|
84 | __table_args__ = {'useexisting':True} | |
85 | user_log_id = Column("user_log_id", Integer(), nullable=False, unique=True, default=None, primary_key=True) |
|
85 | user_log_id = Column("user_log_id", Integer(), nullable=False, unique=True, default=None, primary_key=True) | |
86 | user_id = Column("user_id", Integer(), ForeignKey(u'users.user_id'), nullable=False, unique=None, default=None) |
|
86 | user_id = Column("user_id", Integer(), ForeignKey(u'users.user_id'), nullable=False, unique=None, default=None) | |
87 |
repository_id = Column("repository_id", Integer( |
|
87 | repository_id = Column("repository_id", Integer(), ForeignKey(u'repositories.repo_id'), nullable=True, unique=None, default=None) | |
88 | repository_name = Column("repository_name", String(length=None, convert_unicode=False, ), nullable=True, unique=None, default=None) |
|
88 | repository_name = Column("repository_name", String(length=None, convert_unicode=False, ), nullable=True, unique=None, default=None) | |
89 | user_ip = Column("user_ip", String(length=None, convert_unicode=False, ), nullable=True, unique=None, default=None) |
|
89 | user_ip = Column("user_ip", String(length=None, convert_unicode=False, ), nullable=True, unique=None, default=None) | |
90 | action = Column("action", String(length=None, convert_unicode=False, ), nullable=True, unique=None, default=None) |
|
90 | action = Column("action", String(length=None, convert_unicode=False, ), nullable=True, unique=None, default=None) |
General Comments 0
You need to be logged in to leave comments.
Login now