From 2b823aecdd4a3018020bf12da7e53375a8d882d7 Mon Sep 17 00:00:00 2001 From: Macartur Sousa Date: Tue, 18 Aug 2015 14:01:20 +0000 Subject: [PATCH] Added json file to tests --- colab_spb/fixtures/test_colab_spb.json | 383 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ colab_spb/fixtures/test_data.json | 368 -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- colab_spb/tests/test_get_list.py | 2 +- 3 files changed, 384 insertions(+), 369 deletions(-) create mode 100644 colab_spb/fixtures/test_colab_spb.json delete mode 100644 colab_spb/fixtures/test_data.json diff --git a/colab_spb/fixtures/test_colab_spb.json b/colab_spb/fixtures/test_colab_spb.json new file mode 100644 index 0000000..28019c6 --- /dev/null +++ b/colab_spb/fixtures/test_colab_spb.json @@ -0,0 +1,383 @@ +[ +{ + "fields": { + "logo": "", + "description": "", + "last_imported_index": 0, + "name": "ListA", + "email": "listA@example.com" + }, + "model": "super_archives.mailinglist", + "pk": 1 +}, +{ + "fields": { + "logo": "", + "description": "", + "last_imported_index": 0, + "name": "ListB", + "email": "listB@example.com" + }, + "model": "super_archives.mailinglist", + "pk": 2 +}, +{ + "fields": { + "logo": "", + "description": "", + "last_imported_index": 0, + "name": "ListC", + "email": "listC@example.com" + }, + "model": "super_archives.mailinglist", + "pk": 3 +}, +{ + "fields": { + "spam": false, + "subject_token": "Thread_1_on_List_A", + "mailinglist": 1, + "score": 31, + "latest_message": 3 + }, + "model": "super_archives.thread", + "pk": 1 +}, +{ + "fields": { + "spam": false, + "subject_token": "Thread_1_on_List_B", + "mailinglist": 2, + "score": 0, + "latest_message": 4 + }, + "model": "super_archives.thread", + "pk": 3 +}, +{ + "fields": { + "spam": false, + "subject_token": "Thread_1_on_List_C", + "mailinglist": 3, + "score": 0, + "latest_message": 5 + }, + "model": "super_archives.thread", + "pk": 4 +}, +{ + "fields": { + "spam": false, + "subject_token": "Thread_2_on_List_A", + "mailinglist": 1, + "score": 0, + "latest_message": 6 + }, + "model": "super_archives.thread", + "pk": 5 +}, +{ + "fields": { + "spam": false, + "subject_token": "Thread_3_on_List_A", + "mailinglist": 1, + "score": 0, + "latest_message": 7 + }, + "model": "super_archives.thread", + "pk": 6 +}, +{ + "fields": { + "spam": false, + "subject_token": "Thread_4_on_List_A", + "mailinglist": 1, + "score": 0, + "latest_message": 8 + }, + "model": "super_archives.thread", + "pk": 7 +}, +{ + "fields": { + "spam": false, + "subject_token": "Thread_5_on_List_A", + "mailinglist": 1, + "score": 0, + "latest_message": 9 + }, + "model": "super_archives.thread", + "pk": 8 +}, +{ + "fields": { + "spam": false, + "subject_token": "Thread_6_on_List_A", + "mailinglist": 1, + "score": 0, + "latest_message": 10 + }, + "model": "super_archives.thread", + "pk": 9 +}, +{ + "fields": { + "spam": false, + "subject_token": "Thread_7_on_List_A", + "mailinglist": 1, + "score": 0, + "latest_message": 11 + }, + "model": "super_archives.thread", + "pk": 10 +}, +{ + "fields": { + "spam": false, + "subject_token": "Thread_8_on_List_A", + "mailinglist": 1, + "score": 0, + "latest_message": 12 + }, + "model": "super_archives.thread", + "pk": 11 +}, +{ + "fields": { + "body": "This is a repply to Thread 1 on list A", + "received_time": "2015-01-28T12:43:00.752Z", + "from_address": 1, + "thread": 1, + "spam": false, + "subject_clean": "Response to Thread 1A", + "message_id": "mt1a", + "subject": "Response to Thread 1A" + }, + "model": "super_archives.message", + "pk": 3 +}, +{ + "fields": { + "body": "This is a repply to Thread 2 on list A", + "received_time": "2015-01-28T12:43:00.752Z", + "from_address": 1, + "thread": 5, + "spam": false, + "subject_clean": "Response to Thread 2A", + "message_id": "mt2a", + "subject": "Response to Thread 2A" + }, + "model": "super_archives.message", + "pk": 6 +}, +{ + "fields": { + "body": "This is a repply to Thread 3 on list A", + "received_time": "2015-01-28T12:43:00.752Z", + "from_address": 1, + "thread": 6, + "spam": false, + "subject_clean": "Response to Thread 3A", + "message_id": "mt3a", + "subject": "Response to Thread 3A" + }, + "model": "super_archives.message", + "pk": 7 +}, +{ + "fields": { + "body": "This is a repply to Thread 4 on list A", + "received_time": "2015-01-28T12:43:00.752Z", + "from_address": 1, + "thread": 7, + "spam": false, + "subject_clean": "Response to Thread 4A", + "message_id": "mt4a", + "subject": "Response to Thread 4A" + }, + "model": "super_archives.message", + "pk": 8 +}, +{ + "fields": { + "body": "This is a repply to Thread 5 on list A", + "received_time": "2015-01-28T12:43:00.752Z", + "from_address": 1, + "thread": 8, + "spam": false, + "subject_clean": "Response to Thread 5A", + "message_id": "mt5a", + "subject": "Response to Thread 5A" + }, + "model": "super_archives.message", + "pk": 9 +}, +{ + "fields": { + "body": "This is a repply to Thread 6 on list A", + "received_time": "2015-01-28T12:43:00.752Z", + "from_address": 1, + "thread": 9, + "spam": false, + "subject_clean": "Response to Thread 6A", + "message_id": "mt6a", + "subject": "Response to Thread 6A" + }, + "model": "super_archives.message", + "pk": 10 +}, +{ + "fields": { + "body": "This is a repply to Thread 7 on list A", + "received_time": "2015-01-28T12:43:00.752Z", + "from_address": 1, + "thread": 10, + "spam": false, + "subject_clean": "Response to Thread 7A", + "message_id": "mt7a", + "subject": "Response to Thread 7A" + }, + "model": "super_archives.message", + "pk": 11 +}, +{ + "fields": { + "body": "This is a repply to Thread 8 on list A", + "received_time": "2015-01-28T12:43:00.752Z", + "from_address": 1, + "thread": 11, + "spam": false, + "subject_clean": "Response to Thread 8A", + "message_id": "mt8a", + "subject": "Response to Thread 8A" + }, + "model": "super_archives.message", + "pk": 12 +}, +{ + "fields": { + "body": "This is a repply to Thread 1 on list B", + "received_time": "2015-01-28T12:57:22.180Z", + "from_address": 1, + "thread": 3, + "spam": false, + "subject_clean": "Message 1 on Thread 1B", + "message_id": "", + "subject": "Message 1 on Thread 1B" + }, + "model": "super_archives.message", + "pk": 4 +}, +{ + "fields": { + "body": "This is a repply to Thread 1 on list C", + "received_time": "2015-01-28T13:02:12.903Z", + "from_address": 1, + "thread": 4, + "spam": false, + "subject_clean": "Message 1 on Thread 1C", + "message_id": "", + "subject": "Message 1 on Thread 1C" + }, + "model": "super_archives.message", + "pk": 5 +}, +{ + "fields": { + "last_name": "Administrator", + "webpage": "", + "twitter": "", + "is_staff": true, + "user_permissions": [], + "date_joined": "2015-01-28T12:34:58.770Z", + "google_talk": "", + "first_name": "Admin", + "is_superuser": true, + "last_login": "2015-01-28T12:35:39.621Z", + "verification_hash": null, + "role": "", + "email": "admin@mail.com", + "username": "admin", + "bio": "", + "needs_update": true, + "is_active": true, + "facebook": "", + "groups": [], + "password": "pbkdf2_sha256$12000$iiKCMnLZnFJw$UTx89LB8oYTiw9UqkcglzFLmIaZtbr+ZzF1cG3vfcyo=", + "institution": "", + "github": "", + "modified": "2015-01-28T12:45:27.375Z" + }, + "model": "accounts.user", + "pk": 1 +}, +{ + "fields": { + "last_name": "Norris", + "webpage": "", + "twitter": "", + "is_staff": true, + "user_permissions": [], + "date_joined": "2015-01-28T12:34:58.770Z", + "google_talk": "", + "first_name": "Chuck", + "is_superuser": true, + "last_login": "2015-01-28T12:35:39.621Z", + "verification_hash": null, + "role": "", + "email": "chucknorris@mail.com", + "username": "chucknorris", + "bio": "", + "needs_update": true, + "is_active": true, + "facebook": "", + "groups": [], + "password": "pbkdf2_sha256$12000$iiKCMnLZnFJw$UTx89LB8oYTiw9UqkcglzFLmIaZtbr+ZzF1cG3vfcyo=", + "institution": "", + "github": "", + "modified": "2015-01-28T12:45:27.375Z" + }, + "model": "accounts.user", + "pk": 2 +}, + +{ + "fields": { + "last_name": "Norris", + "webpage": "", + "twitter": "", + "is_staff": true, + "user_permissions": [], + "date_joined": "2015-01-28T12:34:58.770Z", + "google_talk": "", + "first_name": "Heisenberg", + "is_superuser": true, + "last_login": "2015-01-28T12:35:39.621Z", + "verification_hash": null, + "role": "", + "email": "heisenberg@mail.com", + "username": "heisenbergnorris", + "bio": "", + "needs_update": true, + "is_active": true, + "facebook": "", + "groups": [], + "password": "pbkdf2_sha256$12000$iiKCMnLZnFJw$UTx89LB8oYTiw9UqkcglzFLmIaZtbr+ZzF1cG3vfcyo=", + "institution": "", + "github": "", + "modified": "2015-01-28T12:45:27.375Z" + }, + "model": "accounts.user", + "pk": 3 +}, +{ + "fields": { + "real_name": "Administrator", + "user": 1, + "md5": "edb0e96701c209ab4b50211c856c50c4", + "address": "admin@mail.com" + }, + "model": "super_archives.emailaddress", + "pk": 1 +} +] diff --git a/colab_spb/fixtures/test_data.json b/colab_spb/fixtures/test_data.json deleted file mode 100644 index 75568ca..0000000 --- a/colab_spb/fixtures/test_data.json +++ /dev/null @@ -1,368 +0,0 @@ -[ -{ - "fields": { - "description": "List A description.", - "email": "listA@example.com", - "logo": "", - "last_imported_index": 0, - "is_private": false, - "name": "ListA" - }, - "model": "super_archives.mailinglist", - "pk": 1 -}, -{ - "fields": { - "description": "List B description.", - "email": "listB@example.com", - "logo": "", - "last_imported_index": 0, - "is_private": false, - "name": "ListB" - }, - "model": "super_archives.mailinglist", - "pk": 2 -}, -{ - "fields": { - "description": "List C description", - "email": "listC@example.com", - "logo": "", - "last_imported_index": 0, - "is_private": false, - "name": "ListC" - }, - "model": "super_archives.mailinglist", - "pk": 3 -}, -{ - "fields": { - "spam": false, - "subject_token": "Thread_1_on_List_A", - "mailinglist": 1, - "score": 31, - "latest_message": 3 - }, - "model": "super_archives.thread", - "pk": 1 -}, -{ - "fields": { - "spam": false, - "subject_token": "Thread_1_on_List_B", - "mailinglist": 2, - "score": 0, - "latest_message": 4 - }, - "model": "super_archives.thread", - "pk": 3 -}, -{ - "fields": { - "spam": false, - "subject_token": "Thread_1_on_List_C", - "mailinglist": 3, - "score": 0, - "latest_message": 8 - }, - "model": "super_archives.thread", - "pk": 4 -}, -{ - "fields": { - "spam": false, - "subject_token": "Thread_2_on_List_A ", - "mailinglist": 1, - "score": 24, - "latest_message": null - }, - "model": "super_archives.thread", - "pk": 5 -}, -{ - "fields": { - "spam": false, - "subject_token": "Thread_3_on_List_A ", - "mailinglist": 1, - "score": 24, - "latest_message": null - }, - "model": "super_archives.thread", - "pk": 6 -}, -{ - "fields": { - "spam": false, - "subject_token": "Thread_4_on_List_A ", - "mailinglist": 1, - "score": 24, - "latest_message": null - }, - "model": "super_archives.thread", - "pk": 7 -}, -{ - "fields": { - "spam": false, - "subject_token": "Thread_5_on_List_A ", - "mailinglist": 1, - "score": 24, - "latest_message": null - }, - "model": "super_archives.thread", - "pk": 8 -}, -{ - "fields": { - "spam": false, - "subject_token": "Thread_6_on_List_A ", - "mailinglist": 1, - "score": 24, - "latest_message": null - }, - "model": "super_archives.thread", - "pk": 9 -}, -{ - "fields": { - "spam": false, - "subject_token": "Thread_7_on_List_A ", - "mailinglist": 1, - "score": 24, - "latest_message": null - }, - "model": "super_archives.thread", - "pk": 10 -}, -{ - "fields": { - "spam": false, - "subject_token": "Thread_8_on_List_A ", - "mailinglist": 1, - "score": 24, - "latest_message": null - }, - "model": "super_archives.thread", - "pk": 11 -}, -{ - "fields": { - "body": "This is a repply to Thread 1 on list A", - "received_time": "2015-01-28T12:43:00.752Z", - "from_address": 1, - "thread": 1, - "spam": false, - "subject_clean": "Response to Thread 1A", - "message_id": "response_t1a", - "subject": "Response to Thread 1A" - }, - "model": "super_archives.message", - "pk": 3 -}, -{ - "fields": { - "body": "This is a repply to Thread 1 on list B", - "received_time": "2015-01-28T12:57:22.180Z", - "from_address": 1, - "thread": 3, - "spam": false, - "subject_clean": "Response to Thread 1B", - "message_id": "response_t1b", - "subject": "Message 1 on Thread 1B" - }, - "model": "super_archives.message", - "pk": 4 -}, -{ - "fields": { - "body": "This is a repply to Thread 1 on list C", - "received_time": "2015-01-28T13:02:12.903Z", - "from_address": 1, - "thread": 4, - "spam": false, - "subject_clean": "Response to Thread 1C", - "message_id": "response_1t1c", - "subject": "Message 1 on Thread 1C" - }, - "model": "super_archives.message", - "pk": 5 -}, -{ - "fields": { - "body": "This is a repply to Thread 1 on list C", - "received_time": "2015-01-28T13:02:12.903Z", - "from_address": 1, - "thread": 4, - "spam": false, - "subject_clean": "Response 2 to Thread C", - "message_id": "response_2t1c", - "subject": "Message 2 to Thread 1C" - }, - "model": "super_archives.message", - "pk": 6 -}, -{ - "fields": { - "body": "This is a repply to Thread 1 on list C", - "received_time": "2015-01-28T13:02:12.903Z", - "from_address": 1, - "thread": 4, - "spam": false, - "subject_clean": "Response 3 to Thread C", - "message_id": "response_3t1c", - "subject": "Message 3 to Thread 1C" - }, - "model": "super_archives.message", - "pk": 7 -}, -{ - "fields": { - "body": "This is a repply to Thread 1 on list C", - "received_time": "2015-01-28T13:02:12.903Z", - "from_address": 1, - "thread": 4, - "spam": false, - "subject_clean": "Response 4 to Thread C", - "message_id": "response_4t1c", - "subject": "Message 4 to Thread 1C" - }, - "model": "super_archives.message", - "pk": 8 -}, -{ - "fields": { - "last_name": "Administrator", - "webpage": "", - "twitter": "", - "is_staff": true, - "user_permissions": [], - "date_joined": "2015-01-28T12:34:58.770Z", - "google_talk": "", - "first_name": "Admin", - "is_superuser": true, - "last_login": "2015-01-28T12:35:39.621Z", - "verification_hash": null, - "role": "", - "email": "admin@mail.com", - "username": "admin", - "bio": "", - "needs_update": true, - "is_active": true, - "facebook": "", - "groups": [], - "password": "pbkdf2_sha256$12000$iiKCMnLZnFJw$UTx89LB8oYTiw9UqkcglzFLmIaZtbr+ZzF1cG3vfcyo=", - "institution": "", - "github": "", - "modified": "2015-01-28T12:45:27.375Z" - }, - "model": "accounts.user", - "pk": 1 -}, -{ - "fields": { - "last_name": "Norris", - "webpage": "", - "twitter": "", - "is_staff": true, - "user_permissions": [], - "date_joined": "2015-01-28T12:34:58.770Z", - "google_talk": "", - "first_name": "Chuck", - "is_superuser": true, - "last_login": "2015-01-28T12:35:39.621Z", - "verification_hash": null, - "role": "", - "email": "chucknorris@mail.com", - "username": "chucknorris", - "bio": "", - "needs_update": true, - "is_active": true, - "facebook": "", - "groups": [], - "password": "pbkdf2_sha256$12000$iiKCMnLZnFJw$UTx89LB8oYTiw9UqkcglzFLmIaZtbr+ZzF1cG3vfcyo=", - "institution": "", - "github": "", - "modified": "2015-01-28T12:45:27.375Z" - }, - "model": "accounts.user", - "pk": 2 -}, -{ - "fields": { - "last_name": "Norris", - "webpage": "", - "twitter": "", - "is_staff": true, - "user_permissions": [], - "date_joined": "2015-01-28T12:34:58.770Z", - "google_talk": "", - "first_name": "Heisenberg", - "is_superuser": true, - "last_login": "2015-01-28T12:35:39.621Z", - "verification_hash": null, - "role": "", - "email": "heisenberg@mail.com", - "username": "heisenbergnorris", - "bio": "", - "needs_update": true, - "is_active": true, - "facebook": "", - "groups": [], - "password": "pbkdf2_sha256$12000$iiKCMnLZnFJw$UTx89LB8oYTiw9UqkcglzFLmIaZtbr+ZzF1cG3vfcyo=", - "institution": "", - "github": "", - "modified": "2015-01-28T12:45:27.375Z" - }, - "model": "accounts.user", - "pk": 3 -}, -{ - "fields": { - "last_name": "macartur", - "webpage": "", - "twitter": "", - "is_staff": false, - "user_permissions": [], - "date_joined": "2015-08-06T19:23:53Z", - "google_talk": "", - "first_name": "macartur", - "is_superuser": false, - "last_login": "2015-08-10T19:30:49.564Z", - "verification_hash": null, - "role": null, - "email": "macartur.sc@gmail.com", - "username": "macartur", - "bio": null, - "needs_update": false, - "is_active": true, - "facebook": "", - "groups": [], - "password": "pbkdf2_sha256$15000$nK2UEWhXi0pK$82RfvAo2pyarmmig8C5rjSq9s5CQihi4myKazIuozj0=", - "institution": null, - "github": null, - "modified": "2015-08-06T19:25:34.683Z" - }, - "model": "accounts.user", - "pk": 4 -}, -{ - "fields": { - "real_name": "", - "user": 1, - "md5": "edb0e96701c209ab4b50211c856c50c4", - "address": "admin@mail.com" - }, - "model": "super_archives.emailaddress", - "pk": 1 -}, -{ - "fields": { - "validation_key": "78e8af5ec02c44cba40db50d720b06fc", - "created": "2015-08-06T19:23:53.473Z", - "user": 4, - "address": "macartur.sc@gmail.com" - }, - "model": "super_archives.emailaddressvalidation", - "pk": 1 -} -] diff --git a/colab_spb/tests/test_get_list.py b/colab_spb/tests/test_get_list.py index ae54fb6..7a76caa 100644 --- a/colab_spb/tests/test_get_list.py +++ b/colab_spb/tests/test_get_list.py @@ -4,7 +4,7 @@ from django.test import TestCase, Client class ColabSPB(TestCase): - fixtures = ['test_data.json'] + fixtures = ['test_colab_spb.json'] def setUp(self): super(ColabSPB, self).setUp() -- libgit2 0.21.2