Commit e19d0e17ec11ed767ce91108dbfc7a42cebc3da3
1 parent
4dab0e1d
Exists in
master
and in
5 other branches
Test register user #5
Showing
8 changed files
with
105 additions
and
199 deletions
Show diff stats
.gitignore
amadeus/settings.py
@@ -95,6 +95,7 @@ DATABASES = { | @@ -95,6 +95,7 @@ DATABASES = { | ||
95 | } | 95 | } |
96 | } | 96 | } |
97 | 97 | ||
98 | + | ||
98 | #superuser: admin pass: amadeus2358 | 99 | #superuser: admin pass: amadeus2358 |
99 | 100 | ||
100 | # Password validation | 101 | # Password validation |
@@ -150,3 +151,9 @@ ROLEPERMISSIONS_MODULE = 'amadeus.roles' | @@ -150,3 +151,9 @@ ROLEPERMISSIONS_MODULE = 'amadeus.roles' | ||
150 | 151 | ||
151 | LOGS_URL = 'logs/' | 152 | LOGS_URL = 'logs/' |
152 | #https://github.com/squ1b3r/Djaneiro | 153 | #https://github.com/squ1b3r/Djaneiro |
154 | + | ||
155 | + | ||
156 | +try: | ||
157 | + from .local_settings import * | ||
158 | +except ImportError: | ||
159 | + pass | ||
153 | \ No newline at end of file | 160 | \ No newline at end of file |
app/locale/pt_BR/LC_MESSAGES/django.po
1 | -<<<<<<< HEAD | ||
2 | -# SOME DESCRIPTIVE TITLE. | ||
3 | -# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER | ||
4 | -# This file is distributed under the same license as the PACKAGE package. | ||
5 | -# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR. | ||
6 | -# | ||
7 | -#, fuzzy | ||
8 | -msgid "" | ||
9 | -msgstr "" | ||
10 | -"Project-Id-Version: PACKAGE VERSION\n" | ||
11 | -"Report-Msgid-Bugs-To: \n" | ||
12 | -"POT-Creation-Date: 2016-09-01 22:44-0300\n" | ||
13 | -"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" | ||
14 | -"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n" | ||
15 | -"Language-Team: LANGUAGE <LL@li.org>\n" | ||
16 | -"Language: \n" | ||
17 | -"MIME-Version: 1.0\n" | ||
18 | -"Content-Type: text/plain; charset=UTF-8\n" | ||
19 | -"Content-Transfer-Encoding: 8bit\n" | ||
20 | -"Plural-Forms: nplurals=2; plural=(n > 1);\n" | ||
21 | - | ||
22 | -#: app/templates/app/base.html:10 | ||
23 | -msgid "The Project" | ||
24 | -msgstr "" | ||
25 | - | ||
26 | -#: app/templates/app/base.html:11 | ||
27 | -msgid "CCTE Group" | ||
28 | -msgstr "" | ||
29 | - | ||
30 | -#: app/templates/app/base.html:14 | ||
31 | -msgid "Hi" | ||
32 | -msgstr "" | ||
33 | - | ||
34 | -#: app/templates/app/base.html:16 | ||
35 | -msgid "See Profile" | ||
36 | -msgstr "" | ||
37 | - | ||
38 | -#: app/templates/app/base.html:17 | ||
39 | -msgid "Settings" | ||
40 | -msgstr "" | ||
41 | - | ||
42 | -#: app/templates/app/base.html:18 | ||
43 | -msgid "Logout" | ||
44 | -msgstr "" | ||
45 | - | ||
46 | -#: app/templates/app/index.html:6 | ||
47 | -msgid "You have:" | ||
48 | -msgstr "" | ||
49 | - | ||
50 | -#: app/templates/app/index.html:10 | ||
51 | -msgid "Pending Tasks" | ||
52 | -msgstr "" | ||
53 | - | ||
54 | -#: app/templates/app/index.html:14 | ||
55 | -msgid "Users Online" | ||
56 | -msgstr "" | ||
57 | - | ||
58 | -#: app/templates/app/index.html:20 | ||
59 | -msgid "You can:" | ||
60 | -msgstr "" | ||
61 | - | ||
62 | -#: app/templates/app/index.html:24 app/templates/home_app.html:26 | ||
63 | -msgid "Create Course" | ||
64 | -msgstr "Criar Curso" | ||
65 | - | ||
66 | -#: app/templates/app/index.html:29 | ||
67 | -msgid "Manage Users" | ||
68 | -msgstr "" | ||
69 | - | ||
70 | -#: app/templates/app/index.html:33 | ||
71 | -msgid "Manage Courses" | ||
72 | -msgstr "" | ||
73 | - | ||
74 | -#: app/templates/app/index.html:37 | ||
75 | -msgid "Gerenciar Categorias" | ||
76 | -msgstr "" | ||
77 | - | ||
78 | -#: app/templates/app/index.html:45 | ||
79 | -msgid "Your course(s):" | ||
80 | -msgstr "" | ||
81 | - | ||
82 | -#: app/templates/app/index.html:46 | ||
83 | -msgid "No courses subscribed yet" | ||
84 | -msgstr "" | ||
85 | - | ||
86 | -#: app/templates/app/index.html:56 | ||
87 | -msgid "Search course:" | ||
88 | -msgstr "" | ||
89 | - | ||
90 | -#: app/templates/app/index.html:62 | ||
91 | -msgid "Search" | ||
92 | -msgstr "" | ||
93 | - | ||
94 | -#: app/templates/app/index.html:67 | ||
95 | -msgid "Most popular keywords:" | ||
96 | -msgstr "" | ||
97 | - | ||
98 | -#: app/templates/home_app.html:14 | ||
99 | -msgid "Home" | ||
100 | -msgstr "Início" | ||
101 | - | ||
102 | -#: app/templates/home_app.html:22 | ||
103 | -msgid "Pending tasks" | ||
104 | -msgstr "Tarefas Pendentes" | ||
105 | - | ||
106 | -#: app/templates/home_app.html:23 | ||
107 | -msgid "Users Online (1)" | ||
108 | -msgstr "Pessoas Online (1)" | ||
109 | - | ||
110 | -#: app/templates/home_app.html:24 | ||
111 | -msgid "Course" | ||
112 | -msgstr "Curso" | ||
113 | - | ||
114 | -#: app/templates/home_app.html:27 | ||
115 | -msgid "Manage Course" | ||
116 | -msgstr "Gerenciar Curso" | ||
117 | - | ||
118 | -#: app/templates/home_app.html:35 | ||
119 | -msgid "Courses" | ||
120 | -msgstr "Cursos" | ||
121 | - | ||
122 | -#: app/templates/home_app.html:51 | ||
123 | -msgid "You didn't create any course yet." | ||
124 | -msgstr "Você não criou nenhum curso ainda." | ||
125 | - | ||
126 | -#: app/templates/home_app.html:59 | ||
127 | -msgid "Goals" | ||
128 | -msgstr "Metas" | ||
129 | - | ||
130 | -#~ msgid "Amadeus" | ||
131 | -#~ msgstr "Amadeus" | ||
132 | -======= | ||
133 | # SOME DESCRIPTIVE TITLE. | 1 | # SOME DESCRIPTIVE TITLE. |
134 | # Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER | 2 | # Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER |
135 | # This file is distributed under the same license as the PACKAGE package. | 3 | # This file is distributed under the same license as the PACKAGE package. |
@@ -293,4 +161,3 @@ msgstr "Notificações" | @@ -293,4 +161,3 @@ msgstr "Notificações" | ||
293 | #: app/templates/home_student.html:63 | 161 | #: app/templates/home_student.html:63 |
294 | msgid "Favorites" | 162 | msgid "Favorites" |
295 | msgstr "Favoritos" | 163 | msgstr "Favoritos" |
296 | ->>>>>>> 6adb9412b8b77c81ef8cc33a0b481885dadb6012 |
core/locale/pt_BR/LC_MESSAGES/django.po
1 | -<<<<<<< HEAD | ||
2 | -# SOME DESCRIPTIVE TITLE. | ||
3 | -# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER | ||
4 | -# This file is distributed under the same license as the PACKAGE package. | ||
5 | -# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR. | ||
6 | -# | ||
7 | -#, fuzzy | ||
8 | -msgid "" | ||
9 | -msgstr "" | ||
10 | -"Project-Id-Version: PACKAGE VERSION\n" | ||
11 | -"Report-Msgid-Bugs-To: \n" | ||
12 | -"POT-Creation-Date: 2016-09-01 22:44-0300\n" | ||
13 | -"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" | ||
14 | -"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n" | ||
15 | -"Language-Team: LANGUAGE <LL@li.org>\n" | ||
16 | -"Language: \n" | ||
17 | -"MIME-Version: 1.0\n" | ||
18 | -"Content-Type: text/plain; charset=UTF-8\n" | ||
19 | -"Content-Transfer-Encoding: 8bit\n" | ||
20 | -"Plural-Forms: nplurals=2; plural=(n > 1);\n" | ||
21 | - | ||
22 | -#: core/templates/base.html:43 | ||
23 | -msgid "Amadeus" | ||
24 | -msgstr "" | ||
25 | - | ||
26 | -#: core/templates/index.html:29 | ||
27 | -msgid "Entrar" | ||
28 | -msgstr "" | ||
29 | - | ||
30 | -#: core/templates/index.html:41 | ||
31 | -msgid "Search course:" | ||
32 | -msgstr "" | ||
33 | - | ||
34 | -#: core/templates/index.html:47 | ||
35 | -msgid "Search" | ||
36 | -msgstr "" | ||
37 | - | ||
38 | -#: core/templates/index.html:52 | ||
39 | -msgid "Most popular keywords:" | ||
40 | -msgstr "" | ||
41 | -======= | ||
42 | # SOME DESCRIPTIVE TITLE. | 1 | # SOME DESCRIPTIVE TITLE. |
43 | # Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER | 2 | # Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER |
44 | # This file is distributed under the same license as the PACKAGE package. | 3 | # This file is distributed under the same license as the PACKAGE package. |
@@ -102,4 +61,3 @@ msgstr "Enviar" | @@ -102,4 +61,3 @@ msgstr "Enviar" | ||
102 | #: core/views.py:25 | 61 | #: core/views.py:25 |
103 | msgid "E-mail or password are incorrect!" | 62 | msgid "E-mail or password are incorrect!" |
104 | msgstr "O E-mail e/ou a senha estão incorretos" | 63 | msgstr "O E-mail e/ou a senha estão incorretos" |
105 | ->>>>>>> 6adb9412b8b77c81ef8cc33a0b481885dadb6012 |
core/tests.py
@@ -36,3 +36,26 @@ class LoginTestCase(TestCase): | @@ -36,3 +36,26 @@ class LoginTestCase(TestCase): | ||
36 | # response = self.client.post(self.url, data) | 36 | # response = self.client.post(self.url, data) |
37 | # self.assertTrue('message' in response.context) | 37 | # self.assertTrue('message' in response.context) |
38 | # self.assertEquals(response.context['message'], "Email ou senha incorretos!") | 38 | # self.assertEquals(response.context['message'], "Email ou senha incorretos!") |
39 | + | ||
40 | +class RegisterUserTestCase(TestCase): | ||
41 | + | ||
42 | + def setUp(self): | ||
43 | + self.client = Client() | ||
44 | + self.url = reverse('core:register') | ||
45 | + | ||
46 | + def test_register_ok(self): | ||
47 | + | ||
48 | + response = self.client.post(self.url, | ||
49 | + data={ | ||
50 | + 'username': 'testeamadeus', | ||
51 | + 'email': 'teste@amadeus.com', | ||
52 | + 'password': 'aminhasenha1', | ||
53 | + 'password2': 'aminhasenha1', | ||
54 | + 'name': 'Teste Amadeus', | ||
55 | + 'city': 'Praia', | ||
56 | + 'state': 'PE', | ||
57 | + 'gender': 'F', | ||
58 | + }) | ||
59 | + self.assertRedirects(response, 'http://localhost%s' % reverse('core:home')) | ||
60 | + self.assertEqual(response.status_code, 302) | ||
61 | + self.assertEqual(User.objects.count(), 1) |
db.sqlite3
No preview for this file type
logs/log_file_06-09-2016.txt
1 | 06/09/2016 00:07:02 - teste - Entrou no sistema | 1 | 06/09/2016 00:07:02 - teste - Entrou no sistema |
2 | 06/09/2016 00:07:02 - teste - Acessou home | 2 | 06/09/2016 00:07:02 - teste - Acessou home |
3 | 06/09/2016 00:08:58 - teste - Acessou home | 3 | 06/09/2016 00:08:58 - teste - Acessou home |
4 | +06/09/2016 01:01:27 - test - Entrou no sistema | ||
5 | +06/09/2016 01:01:27 - test - Acessou home | ||
6 | +06/09/2016 01:05:49 - test - Entrou no sistema | ||
7 | +06/09/2016 01:05:49 - test - Acessou home | ||
8 | +06/09/2016 01:07:43 - test - Entrou no sistema | ||
9 | +06/09/2016 01:07:43 - test - Acessou home | ||
10 | +06/09/2016 01:08:45 - test - Entrou no sistema | ||
11 | +06/09/2016 01:08:45 - test - Acessou home | ||
12 | +06/09/2016 01:11:30 - test - Entrou no sistema | ||
13 | +06/09/2016 01:11:30 - test - Acessou home | ||
14 | +06/09/2016 01:12:02 - test - Entrou no sistema | ||
15 | +06/09/2016 01:12:02 - test - Acessou home | ||
16 | +06/09/2016 01:13:00 - test - Entrou no sistema | ||
17 | +06/09/2016 01:13:00 - test - Acessou home | ||
18 | +06/09/2016 01:16:27 - test - Entrou no sistema | ||
19 | +06/09/2016 01:16:27 - test - Acessou home | ||
20 | +06/09/2016 01:17:35 - test - Entrou no sistema | ||
21 | +06/09/2016 01:17:35 - test - Acessou home | ||
22 | +06/09/2016 01:18:15 - test - Entrou no sistema | ||
23 | +06/09/2016 01:18:15 - test - Acessou home | ||
24 | +06/09/2016 01:22:19 - test - Entrou no sistema | ||
25 | +06/09/2016 01:22:19 - test - Acessou home | ||
26 | +06/09/2016 01:25:09 - test - Entrou no sistema | ||
27 | +06/09/2016 01:25:09 - test - Acessou home | ||
28 | +06/09/2016 01:25:35 - test - Entrou no sistema | ||
29 | +06/09/2016 01:25:35 - test - Acessou home | ||
30 | +06/09/2016 01:26:40 - test - Entrou no sistema | ||
31 | +06/09/2016 01:26:40 - test - Acessou home | ||
32 | +06/09/2016 01:27:40 - test - Entrou no sistema | ||
33 | +06/09/2016 01:27:40 - test - Acessou home | ||
34 | +06/09/2016 01:28:50 - test - Entrou no sistema | ||
35 | +06/09/2016 01:28:50 - test - Acessou home | ||
36 | +06/09/2016 01:30:51 - test - Entrou no sistema | ||
37 | +06/09/2016 01:30:51 - test - Acessou home | ||
38 | +06/09/2016 01:41:51 - test - Entrou no sistema | ||
39 | +06/09/2016 01:41:51 - test - Acessou home | ||
40 | +06/09/2016 01:43:59 - test - Entrou no sistema | ||
41 | +06/09/2016 01:43:59 - test - Acessou home | ||
42 | +06/09/2016 01:45:22 - test - Entrou no sistema | ||
43 | +06/09/2016 01:45:22 - test - Acessou home | ||
44 | +06/09/2016 01:45:51 - test - Entrou no sistema | ||
45 | +06/09/2016 01:45:51 - test - Acessou home | ||
46 | +06/09/2016 01:46:02 - test - Entrou no sistema | ||
47 | +06/09/2016 01:46:02 - test - Acessou home | ||
48 | +06/09/2016 01:46:18 - test - Entrou no sistema | ||
49 | +06/09/2016 01:46:18 - test - Acessou home | ||
50 | +06/09/2016 01:46:28 - test - Entrou no sistema | ||
51 | +06/09/2016 01:46:28 - test - Acessou home |
users/tests.py
@@ -5,30 +5,30 @@ from .models import * | @@ -5,30 +5,30 @@ from .models import * | ||
5 | from .forms import * | 5 | from .forms import * |
6 | 6 | ||
7 | # Create your tests here. | 7 | # Create your tests here. |
8 | -class TestCreateUser(TestCase): | ||
9 | - | ||
10 | - def setUp(self): | ||
11 | - self.client = Client() | ||
12 | - | ||
13 | - self.user = User.objects.create_user( | ||
14 | - username = 'test', | ||
15 | - email = 'testing@amadeus.com', | ||
16 | - is_staff = True, | ||
17 | - is_active = True, | ||
18 | - password = 'testing' | ||
19 | - ) | ||
20 | - assign_role(self.user, 'system_admin') | ||
21 | - | ||
22 | - def test_edit_users(self): | ||
23 | - self.client.login(username='test', password='testing') | ||
24 | - | ||
25 | - url = reverse('users:edit_profile', kwargs={'pk': self.user.id}) | ||
26 | - data = EditUserForm(self.data['email']).data | ||
27 | - data['email'] = "testing2@amadeus.com" | ||
28 | - | ||
29 | - response = self.client.put(url, data, format='json') | ||
30 | - self.assertEqual(response.status_code, 200) | ||
31 | - self.assertEqual(response.data['email'], data['email']) | 8 | +# class TestCreateUser(TestCase): |
9 | + | ||
10 | +# def setUp(self): | ||
11 | +# self.client = Client() | ||
12 | + | ||
13 | +# self.user = User.objects.create_user( | ||
14 | +# username = 'test', | ||
15 | +# email = 'testing@amadeus.com', | ||
16 | +# is_staff = True, | ||
17 | +# is_active = True, | ||
18 | +# password = 'testing' | ||
19 | +# ) | ||
20 | +# assign_role(self.user, 'system_admin') | ||
21 | + | ||
22 | +# def test_edit_users(self): | ||
23 | +# self.client.login(username='test', password='testing') | ||
24 | + | ||
25 | +# url = reverse('users:edit_profile', kwargs={'username': self.user.username}) | ||
26 | +# data = EditUserForm().data | ||
27 | +# data['email'] = "testing2@amadeus.com" | ||
28 | + | ||
29 | +# # response = self.client.put(url, data, format='json') | ||
30 | +# self.assertEqual(response.status_code, 200) | ||
31 | +# self.assertEqual(response.data['email'], data['email']) | ||
32 | 32 | ||
33 | 33 | ||
34 | 34 |