forked from barseghyanartur/django-qartez
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
68e56fd
commit 3e187eb
Showing
21 changed files
with
192 additions
and
28 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
Release history | ||
===================================== | ||
0.6 | ||
------------------------------------- | ||
2014-10-12 | ||
|
||
- Django 1.7 support. | ||
|
||
0.5 | ||
------------------------------------- | ||
2013-09-09 | ||
|
||
- Python 3 support. | ||
|
||
0.1 | ||
------------------------------------- | ||
2013-02-04 | ||
|
||
- Initial. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,4 @@ | ||
./uninstall.sh | ||
./install.sh | ||
sphinx-build -n -a -b html docs builddocs | ||
sphinx-build -n -a -b html docs builddocs | ||
cd builddocs && zip -r ../builddocs.zip . -x ".*" && cd .. |
File renamed without changes.
4 changes: 3 additions & 1 deletion
4
example/example/foo/management/commands/foo_create_test_data.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
Django==1.5.2 | ||
Pillow==2.1.0 | ||
argparse==1.2.1 | ||
django-qartez==0.5 | ||
radar==0.2 | ||
six==1.4.1 | ||
wsgiref==0.1.2 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,7 @@ | ||
Django==1.5.1 | ||
Pillow==2.0.0 | ||
argparse==1.2.1 | ||
django-debug-toolbar==0.9.4 | ||
django-qartez==0.3 | ||
ipdb==0.7 | ||
ipython==0.13.2 | ||
qartez==0.3 | ||
wsgiref==0.1.2 | ||
Django>=1.5,<1.8 | ||
Pillow | ||
argparse | ||
django-debug-toolbar | ||
ipdb | ||
ipython | ||
wsgiref |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
__title__ = 'qartez.tests' | ||
__author__ = 'Artur Barseghyan' | ||
__copyright__ = 'Copyright (c) 2013-2014 Artur Barseghyan' | ||
__license__ = 'GPL 2.0/LGPL 2.1' | ||
|
||
import unittest | ||
|
||
from qartez.tests.test_sitemaps import * | ||
|
||
if __name__ == '__main__': | ||
unittest.main() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
from __future__ import print_function | ||
|
||
__title__ = 'qartez.tests.base' | ||
__author__ = 'Artur Barseghyan' | ||
__copyright__ = 'Copyright (c) 2013-2014 Artur Barseghyan' | ||
__license__ = 'GPL 2.0/LGPL 2.1' | ||
|
||
PRINT_INFO = True | ||
|
||
def print_info(func): | ||
""" | ||
Prints some useful info. | ||
""" | ||
if not PRINT_INFO: | ||
return func | ||
|
||
def inner(self, *args, **kwargs): | ||
result = func(self, *args, **kwargs) | ||
|
||
print('\n\n%s' % func.__name__) | ||
print('============================') | ||
if func.__doc__: | ||
print('""" %s """' % func.__doc__.strip()) | ||
print('----------------------------') | ||
if result is not None: | ||
print(result) | ||
print('\n++++++++++++++++++++++++++++') | ||
|
||
return result | ||
return inner |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,98 @@ | ||
__title__ = 'qartez.tests.test_sitemaps' | ||
__author__ = 'Artur Barseghyan' | ||
__copyright__ = 'Copyright (c) 2013-2014 Artur Barseghyan' | ||
__license__ = 'GPL 2.0/LGPL 2.1' | ||
|
||
import unittest | ||
import os | ||
|
||
# Skipping from non-Django tests. | ||
if os.environ.get("DJANGO_SETTINGS_MODULE", None): | ||
from django.test import Client | ||
|
||
from qartez.tests.base import print_info | ||
|
||
class QartezTest(unittest.TestCase): | ||
""" | ||
Testing sitemaps. | ||
""" | ||
def setUp(self): | ||
# Testing the URLs | ||
self.urls = { | ||
'sitemap of sitemaps': '/sitemap.xml', | ||
'normal sitemap': '/sitemap-foo-items.xml', | ||
'images sitemap': '/sitemap-foo-images.xml', | ||
'static sitemap': '/sitemap-foo-static.xml', | ||
'alternative hreflang sitemap': '/sitemap-foo-items-alternate-hreflang.xml', | ||
} | ||
|
||
@print_info | ||
def test_all_sitemaps(self): | ||
""" | ||
Test the all sitemaps. | ||
""" | ||
flow = [] | ||
## Testing view with signed URL | ||
client = Client() | ||
for description, url in self.urls.items(): | ||
response = client.get(url, {}) | ||
self.assertTrue(response.status_code in (200, 201, 202)) | ||
flow.append( | ||
'Response status code for {0} is {1}'.format( | ||
description, response.status_code | ||
) | ||
) | ||
|
||
return flow | ||
|
||
@print_info | ||
def test_01_alternative_hreflang_sitemap(self): | ||
""" | ||
Test alternate hreflang sitemap. | ||
""" | ||
flow = [] | ||
c = Client() | ||
response = c.get('/sitemap-foo-items-alternate-hreflang.xml', {}) | ||
self.assertTrue('hreflang="en-us"' in response.content) | ||
self.assertTrue('rel="alternate"' in response.content) | ||
self.assertTrue('hreflang="en-us"' in response.content) | ||
|
||
@print_info | ||
def test_02_static_sitemap(self): | ||
""" | ||
Test static sitemap. | ||
""" | ||
flow = [] | ||
c = Client() | ||
response = c.get('/sitemap-foo-static.xml', {}) | ||
self.assertTrue('http://example.com/foo/contact/' in response.content) | ||
|
||
@print_info | ||
def test_03_images_sitemap(self): | ||
""" | ||
Test images sitemap. | ||
""" | ||
flow = [] | ||
c = Client() | ||
response = c.get('/sitemap-foo-images.xml', {}) | ||
self.assertTrue('http://www.google.com/schemas/sitemap-image/1.1' in response.content) | ||
self.assertTrue('<image:title>' in response.content) | ||
self.assertTrue('<image:loc>' in response.content) | ||
self.assertTrue('<image:image>' in response.content) | ||
|
||
@print_info | ||
def test_04_sitemap_of_sitemaps(self): | ||
""" | ||
Test sitemap of sitemaps. | ||
""" | ||
flow = [] | ||
c = Client() | ||
response = c.get('/sitemap.xml', {}) | ||
self.assertTrue('<sitemapindex xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">' in response.content) | ||
self.assertTrue('https://example.com/sitemap-foo-items-alternate-hreflang.xml' in response.content) | ||
self.assertTrue('http://example.com/sitemap-foo-items.xml' in response.content) | ||
|
||
|
||
if __name__ == "__main__": | ||
# Tests | ||
unittest.main() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
reset | ||
./uninstall.sh | ||
./install.sh | ||
python example/example/manage.py test qartez --traceback -v 3 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters