New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Views return JSON in addition to HTML #10

Merged
merged 7 commits into from Jun 11, 2012

Conversation

Projects
None yet
2 participants
@axitkhurana
Contributor

axitkhurana commented Jun 7, 2012

No description provided.

@mapleoin

This comment has been minimized.

Show comment
Hide comment
@mapleoin

mapleoin Jun 8, 2012

Owner

I'm getting these errors when running the tests. It seems like they only worked yesterday. You shouldn't hardcode the date.

FAIL: test_package_json (popcorn.test.test_views.PopcornTestCase)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/mapleoin/popcorn/popcorn/test/test_views.py", line 190, in test_package_json
    "pkg_release": "5.1.2"
AssertionError: {'packages': [{'sys_hwuuid': '677ec7c2-3b9e-4b25-8f45-b651d8bbb701', 'sub_date': [truncated]... != {'packages': [{'pkg_status': 'voted', 'sys_hwuuid': '677ec7c2-3b9e-4b25-8f45-b65 [truncated]...
Diff is 1182 characters long. Set self.maxDiff to None to see it.

======================================================================
FAIL: test_system_json (popcorn.test.test_views.PopcornTestCase)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/mapleoin/popcorn/popcorn/test/test_views.py", line 157, in test_system_json
    "distro_version": "12.1"
AssertionError: {'system': {'submissions': [{'sub_date': ['2012-06-08', '00:00:00'], 'sys_hwuuid [truncated]... != {'system': {'submissions': [{'sub_date': ['2012-06-07', '00:00:00'], 'sys_hwuuid [truncated]...
  {'system': {'arch': 'x86_64',
              'distro_name': 'openSUSE',
              'distro_version': '12.1',
              'submissions': [{'popcorn_version': '0.1',
-                              'sub_date': ['2012-06-08', '00:00:00'],
?                                                     ^

+                              'sub_date': ['2012-06-07', '00:00:00'],
?                                                     ^

                               'sys_hwuuid': '677ec7c2-3b9e-4b25-8f45-b651d8bbb701'}],
              'sys_hwuuid': '677ec7c2-3b9e-4b25-8f45-b651d8bbb701'}}

----------------------------------------------------------------------
Owner

mapleoin commented Jun 8, 2012

I'm getting these errors when running the tests. It seems like they only worked yesterday. You shouldn't hardcode the date.

FAIL: test_package_json (popcorn.test.test_views.PopcornTestCase)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/mapleoin/popcorn/popcorn/test/test_views.py", line 190, in test_package_json
    "pkg_release": "5.1.2"
AssertionError: {'packages': [{'sys_hwuuid': '677ec7c2-3b9e-4b25-8f45-b651d8bbb701', 'sub_date': [truncated]... != {'packages': [{'pkg_status': 'voted', 'sys_hwuuid': '677ec7c2-3b9e-4b25-8f45-b65 [truncated]...
Diff is 1182 characters long. Set self.maxDiff to None to see it.

======================================================================
FAIL: test_system_json (popcorn.test.test_views.PopcornTestCase)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/mapleoin/popcorn/popcorn/test/test_views.py", line 157, in test_system_json
    "distro_version": "12.1"
AssertionError: {'system': {'submissions': [{'sub_date': ['2012-06-08', '00:00:00'], 'sys_hwuuid [truncated]... != {'system': {'submissions': [{'sub_date': ['2012-06-07', '00:00:00'], 'sys_hwuuid [truncated]...
  {'system': {'arch': 'x86_64',
              'distro_name': 'openSUSE',
              'distro_version': '12.1',
              'submissions': [{'popcorn_version': '0.1',
-                              'sub_date': ['2012-06-08', '00:00:00'],
?                                                     ^

+                              'sub_date': ['2012-06-07', '00:00:00'],
?                                                     ^

                               'sys_hwuuid': '677ec7c2-3b9e-4b25-8f45-b651d8bbb701'}],
              'sys_hwuuid': '677ec7c2-3b9e-4b25-8f45-b651d8bbb701'}}

----------------------------------------------------------------------
@axitkhurana

This comment has been minimized.

Show comment
Hide comment
@axitkhurana

axitkhurana Jun 8, 2012

Contributor

Sorry, I missed that. Fixed now. Can you please take a look again?

Contributor

axitkhurana commented Jun 8, 2012

Sorry, I missed that. Fixed now. Can you please take a look again?

add tests for json from views
add tests for index, system, package and distro views

mapleoin added a commit that referenced this pull request Jun 11, 2012

Merge pull request #10 from axitkhurana/api
Views return JSON in addition to HTML

@mapleoin mapleoin merged commit eb1aa4f into mapleoin:master Jun 11, 2012

@mapleoin

This comment has been minimized.

Show comment
Hide comment
@mapleoin

mapleoin Jun 11, 2012

Owner

Good job. Thanks!

Owner

mapleoin commented Jun 11, 2012

Good job. Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment