コード例 #1
0
    def setUp(self):
        self.user = UserFactory(username='******', password='******')
        self.other_user = UserFactory(username='******', password='******')

        self.action = ActionFactory(user=self.user)
        self.action1 = ActionFactory(user=self.other_user)
        actions = [self.action, self.action1]

        for action in actions:
            for _ in range(1, 10):
                RecordFactory(action=action)

        self.url = '/records'
コード例 #2
0
ファイル: test_views.py プロジェクト: andreyvpng/lifelog
 def setUp(self):
     self.user = UserFactory(username='******', password='******')
     self.other = UserFactory(username='******', password='******')
     self.action = ActionFactory(user=self.user)
     self.goal = GoalFactory(action=self.action)
     self.url = '/goal/update/action/{}'.format(
         self.action.id)
     self.object = {'action': self.action,
                    'daily_value': 100}
コード例 #3
0
class ActionTest(TestCase):

    def setUp(self):
        self.action = ActionFactory()

    def test_str(self):
        self.assertEqual(self.action.__str__(), '{} ({})'.format(
            self.action.text,
            self.action.unit
        ))
コード例 #4
0
    def setUp(self):
        self.user = UserFactory(username='******', password='******')
        self.other_user = UserFactory(username='******', password='******')
        users = [self.user, self.other_user]

        for user in users:
            for _ in range(1, 10):
                ActionFactory(user=user)

        self.url = '/actions'
コード例 #5
0
    def setUp(self):
        self.user = UserFactory(username='******', password='******')
        self.other_user = UserFactory(username='******', password='******')

        self.object = {
            'text': 'Book Reading',
            'color': 1,
            'unit': 'pages',
            'user': self.user
        }

        self.action = ActionFactory(**self.object)
        self.url = '/record-create'

        self.new_record = {'action': self.action.id, 'value': 100}
コード例 #6
0
    def setUp(self):
        self.user = UserFactory(username='******', password='******')
        self.other_user = UserFactory(username='******', password='******')

        self.object = {'text': 'Action', 'color': 2, 'unit': 'unit'}

        self.action = ActionFactory(user=self.user, **self.object)

        self.update_object = {
            'text': 'Book Reading',
            'color': 1,
            'unit': 'pages'
        }

        self.url = '/action-update/{}'.format(self.action.id)
コード例 #7
0
ファイル: test_views.py プロジェクト: andreyvpng/lifelog
 def setUp(self):
     self.user = UserFactory(username='******', password='******')
     self.action = ActionFactory(user=self.user)
コード例 #8
0
 def setUp(self):
     self.action = ActionFactory()
コード例 #9
0
 def setUp(self):
     self.user = UserFactory(username='******', password='******')
     self.other_user = UserFactory(username='******', password='******')
     self.action = ActionFactory(user=self.user)
     self.url = '/action-delete/{}'.format(self.action.id)