Jakub Zalewski avatar Jakub Zalewski committed 1f06441

get ring of checking content message in tests, pass test, add translation pl

Comments (0)

Files changed (4)

Add a comment to this file

friends/locale/pl/LC_MESSAGES/django.mo

Binary file added.

friends/locale/pl/LC_MESSAGES/django.po

+# SOME DESCRIPTIVE TITLE.
+# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER
+# This file is distributed under the same license as the PACKAGE package.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2011-05-19 00:03+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: \n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+"Plural-Forms:  nplurals=3; plural=(n==1 ? 0 : n%10>=2 && n%10<=4 && (n%"
+"100<10 || n%100>=20) ? 1 : 2);\n"
+
+#: models.py:9
+msgid "invited"
+msgstr "zaproszony"
+
+#: models.py:10
+msgid "inviting"
+msgstr "zapraszający"
+
+#: models.py:22
+msgid "friendship"
+msgstr "znajomość"
+
+#: models.py:23
+msgid "friend relations"
+msgstr "znajomości"
+
+#: views.py:62
+msgid "friend confirmed"
+msgstr "potwierdzony"
+
+#: views.py:69
+msgid "friend invited"
+msgstr "zaproszony"
+
+#: views.py:86
+msgid "friend deleted"
+msgstr "usunięty"
+
+#: views.py:95
+msgid "invite rejected"
+msgstr "odrzucony"
+
+#: templates/friends/friend_button.html:7
+msgid "accept request"
+msgstr "zaakceptuj"
+
+#: templates/friends/friend_button.html:10
+msgid "awaiting confirmation"
+msgstr "oczekuje na potwierdzenie"
+
+#: templates/friends/friend_button.html:12
+msgid "send friend request"
+msgstr "zaproś"
+
+#: templates/friends/friends_base.html:9 templates/friends/user_friends.html:6
+msgid "friends"
+msgstr "znajomi"
+
+#: templates/friends/friends_list.html:9
+msgid "no friends yet"
+msgstr "brak znajomych"
+
+#: templates/friends/user_friends.html:6
+msgid "my friends"
+msgstr "moi znajomi"
+
+#: templates/friends/users_list_example.html:5
+msgid "users list"
+msgstr "użytkownicy"
+
+#: templates/includes/pagination.html:5
+msgid "previous"
+msgstr "poprzedni"
+
+#: templates/includes/pagination.html:7
+#, python-format
+msgid "page %(page)s of %(pages)s"
+msgstr "strona  %(page)s z %(pages)s"
+
+#: templates/includes/pagination.html:9
+msgid "next"
+msgstr "następny"

friends/templates/friends/friends_list.html

 	{% endfor %}
 </ul> 	
 {% else %}
-	<p>{% trans "no friends yet." %}</p>
+	<p>{% trans "no friends yet" %}</p>
 {% endif %}
 from django.contrib.auth.models import User
 from friends.models import Friendship
 from django.core.urlresolvers import reverse
-
+from django.utils.translation import ugettext, activate
+from django.conf import settings 
    
 class TestFriends(TestCase):
     
     def setUp(self):
         self.client = Client()
+        activate(settings.LANGUAGE_CODE)
         user, created = User.objects.get_or_create(username='eloyo')
         user.set_password('test')
         user.save()
         self.log_in()
         response = self.client.get(reverse('ajax_friend_add', args=[self.users[0].id]))
         self.assertEqual(response.status_code, 200)
-        self.assertEqual(response.content, '{"message": "friend invited", "id": 1}')
+        self.assertContains(response, '"id": %d' % 1)
     
         
     def test_ajax_accept_invite(self):
         self.log_in()
         response = self.client.get(reverse('ajax_friend_add', args=[self.users[4].id]))
         self.assertEqual(response.status_code, 200)
-        self.assertEqual(response.content, '{"message": "friend confirmed", "id": %d}' % fs.id)
+        self.assertContains(response, '"id": %d' % fs.id)
     
                 
     def test_ajax_reject_invite(self):
         self.log_in()
         response = self.client.get(reverse('ajax_friend_remove', args=[fs.id]))
         self.assertEqual(response.status_code, 200)
-        self.assertEqual(response.content, '{"message": "invite rejected", "id": %d}' % fs.id)        
+        self.assertContains(response, '"id": %d' % fs.id)       
     
     
     def test_ajax_remove_friend(self):
         self.assertEqual(response.content, '{"not_authenticated": true}')
         self.log_in()
         response = self.client.get(reverse('ajax_friend_remove', args=[fs.id]))
-        self.assertEqual(response.status_code, 200)
-        self.assertEqual(response.content, '{"message": "friend deleted", "id": %d}' % fs.id)
+        self.assertEqual(response.status_code, 200)        
+        self.assertContains(response, '"id": %d' % fs.id)
+        
                 
     
-        
-    
-    
     
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.