コード例 #1
0
ファイル: test_views.py プロジェクト: min054/eggtimer-server
    def test_qigong_cycles_no_birth_date(self):
        self.request.user.birth_date = None
        self.request.user.save()

        response = views.qigong_cycles(self.request)

        result = json.loads(response.content.decode('utf-8'))

        self.assertEqual({}, result)
コード例 #2
0
ファイル: test_views.py プロジェクト: min054/eggtimer-server
    def test_qigong_cycles(self, mocktoday):
        mocktoday.return_value = TIMEZONE.localize(datetime.datetime(1995, 3, 20))

        response = views.qigong_cycles(self.request)

        result = json.loads(response.content.decode('utf-8'))

        expected = {
            'physical': [['1995-03-01T00:00:00-05:00', 0],
                         ['1995-03-12T12:00:00-05:00', 100],
                         ['1995-03-20T00:00:00-05:00', 27],
                         ['1995-03-24T00:00:00-05:00', 0],
                         ['1995-04-03T00:00:00-05:00', 96]],
            'emotional': [['1995-03-01T00:00:00-05:00', 0],
                          ['1995-03-15T00:00:00-05:00', 100],
                          ['1995-03-20T00:00:00-05:00', 72],
                          ['1995-03-29T00:00:00-05:00', 0],
                          ['1995-04-03T00:00:00-05:00', 28]],
            'intellectual': [['1995-03-01T00:00:00-05:00', 0],
                             ['1995-03-17T12:00:00-05:00', 100],
                             ['1995-03-20T00:00:00-05:00', 94],
                             ['1995-04-03T00:00:00-05:00', 0]],
        }
        self.assertEqual(expected, result)